[PATCH] chg: change default connect timeout to 60 seconds

Jun Wu quark at fb.com
Wed Jun 15 21:04:15 UTC 2016


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1466022991 -3600
#      Wed Jun 15 21:36:31 2016 +0100
# Node ID 076ec3f9d8df2453c995b598cf71e996273ad1e4
# Parent  2188f170f5b60eaddd1f1d6539de2ec07d19e1e3
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 076ec3f9d8df
chg: change default connect timeout to 60 seconds

As discussed at
https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-June/085290.html

The default 10-second timeout is not enough if the machine is overloaded.
Let's increase it to 60 seconds.

diff --git a/contrib/chg/README b/contrib/chg/README
--- a/contrib/chg/README
+++ b/contrib/chg/README
@@ -29,4 +29,4 @@
  * CHGDEBUG enables debug messages.
  * CHGSOCKNAME specifies the socket path of the background cmdserver.
  * CHGTIMEOUT specifies how many seconds chg will wait before giving up
-   connecting to a cmdserver. If it is 0, chg will wait forever. Default: 10
+   connecting to a cmdserver. If it is 0, chg will wait forever. Default: 60
diff --git a/contrib/chg/chg.c b/contrib/chg/chg.c
--- a/contrib/chg/chg.c
+++ b/contrib/chg/chg.c
@@ -250,7 +250,7 @@
 
 	debugmsg("try connect to %s repeatedly", opts->sockname);
 
-	unsigned int timeoutsec = 10;  /* default: 10 seconds */
+	unsigned int timeoutsec = 60;  /* default: 60 seconds */
 	const char *timeoutenv = getenv("CHGTIMEOUT");
 	if (timeoutenv)
 		sscanf(timeoutenv, "%u", &timeoutsec);


More information about the Mercurial-devel mailing list