Patchwork chg: change default connect timeout to 60 seconds

login
register
mail settings
Submitter Jun Wu
Date June 15, 2016, 9:04 p.m.
Message ID <076ec3f9d8df2453c995.1466024655@x1c>
Download mbox | patch
Permalink /patch/15525/
State Accepted
Headers show

Comments

Jun Wu - June 15, 2016, 9:04 p.m.
# HG changeset patch
# User Jun Wu <quark@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.
Yuya Nishihara - June 16, 2016, 1:53 p.m.
On Wed, 15 Jun 2016 22:04:15 +0100, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark@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

Queued, thanks.

Patch

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);