From: Zac Medico Date: Mon, 28 May 2007 07:32:25 +0000 (-0000) Subject: For bug #180009, add a PORTAGE_RSYNC_INITIAL_TIMEOUT config variable. The default... X-Git-Tag: v2.1.2.9~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7d9ec2790d9c89a3e111fc94b7fb4a4917f74c96;p=portage.git For bug #180009, add a PORTAGE_RSYNC_INITIAL_TIMEOUT config variable. The default is 15 seconds and it can be disabled by setting it to 0. (trunk r6650) svn path=/main/branches/2.1.2/; revision=6651 --- diff --git a/bin/emerge b/bin/emerge index eca2b24c1..7b5e6f378 100755 --- a/bin/emerge +++ b/bin/emerge @@ -3944,6 +3944,12 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): pass del content + try: + rsync_initial_timeout = \ + int(settings.get("PORTAGE_RSYNC_INITIAL_TIMEOUT", "15")) + except ValueError: + rsync_initial_timeout = 15 + try: if settings.has_key("RSYNC_RETRIES"): print yellow("WARNING:")+" usage of RSYNC_RETRIES is deprecated, use PORTAGE_RSYNC_RETRIES instead" @@ -4054,14 +4060,16 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): # Timeout here in case the server is unresponsive. The # --timeout rsync option doesn't apply to the initial # connection attempt. - signal.alarm(15) + if rsync_initial_timeout: + signal.alarm(rsync_initial_timeout) try: mypids.extend(portage_exec.spawn( mycommand, env=settings.environ(), returnpid=True)) exitcode = os.waitpid(mypids[0], 0)[1] content = portage.grabfile(tmpservertimestampfile) finally: - signal.alarm(0) + if rsync_initial_timeout: + signal.alarm(0) try: os.unlink(tmpservertimestampfile) except OSError: diff --git a/man/make.conf.5 b/man/make.conf.5 index dc01a2c55..65de528bb 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -357,6 +357,12 @@ emerge is running at. In other words, this will not set the nice level, it will increment it. For more information about nice levels and what are acceptable ranges, see \fBnice\fR(1). .TP +\fBPORTAGE_RSYNC_INITIAL_TIMEOUT\fR = \fIinteger\fR +Used by \fBemerge \-\-sync\fR as a timeout for the initial connection to an +rsync server. +.br +Defaults to 15 seconds. +.TP \fBPORTAGE_RSYNC_EXTRA_OPTS\fR = \fI[rsync options string]\fR Additional rsync options to be used by \fBemerge \-\-sync\fR. .br