[PATCH] chg: make timeout adjustable

Yuya Nishihara yuya at tcha.org
Tue Jun 14 10:20:49 EDT 2016


On Mon, 13 Jun 2016 21:41:26 +0100, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1465849814 -3600
> #      Mon Jun 13 21:30:14 2016 +0100
> # Node ID e7be85fe1486decc6f0e7e46df7cbbb30a249668
> # Parent  c27dc3c31222c7f74331221a3d25566146feecac
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r e7be85fe1486
> chg: make timeout adjustable

Looks fine, queued. Thanks.

> Before this patch, chg will give up when it cannot connect to the new server
> within 10 seconds. If the host has high load during that time, 10 seconds
> is not enough.
> 
> This patch makes it adjustable using the CHGTIMEOUT environment variable.

Is it mainly for automated tests?

> +	unsigned int timeoutsec = 10;  /* default: 10 seconds */
> +	const char *timeoutenv = getenv("CHGTIMEOUT");
> +	if (timeoutenv)
> +		sscanf(timeoutenv, "%u", &timeoutsec);

I was slightly afraid of this, but it seems fine to expect the original
timeoutsec is kept unmodified on failure.

http://stackoverflow.com/questions/25715204/


More information about the Mercurial-devel mailing list