darcs

Patch 1057 correctly set curl connection timeout

Title correctly set curl connection timeout
Superseder Nosy List gh
Related Issues
Status accepted Assigned To
Milestone

Created on 2013-02-21.23:49:01 by gh, last changed 2013-04-25.21:51:36 by gh.

Files
File name Status Uploaded Type Edit Remove
correctly-set-curl-connection-timeout.dpatch gh, 2013-02-21.23:49:00 application/x-darcs-patch
correctly-set-curl-connection-timeout.dpatch gh, 2013-02-22.10:20:39 application/x-darcs-patch
patch-preview.txt gh, 2013-02-21.23:49:00 text/x-darcs-patch
patch-preview.txt gh, 2013-02-22.10:10:58 text/x-darcs-patch
patch-preview.txt gh, 2013-02-22.10:20:39 text/x-darcs-patch
set-timeout-to-1-second-in-expire_unused_caches-test.dpatch gh, 2013-02-22.10:10:58 application/x-darcs-patch
unnamed gh, 2013-02-21.23:49:00
unnamed gh, 2013-02-22.10:10:58
unnamed gh, 2013-02-22.10:20:39
See mailing list archives for discussion on individual patches.
Messages
msg16717 (view) Author: gh Date: 2013-02-21.23:49:00
This patch makes that DARCS_CONNECTION_TIMEOUT is taken into account.
Noticeably, in cases like the following (non-responding server):

    export DARCS_CONNECTION_TIMEOUT=1 && darcs changes --repo=http://10.1.2.3/

Also, it seems that the correct parameter to pass to libcurl is
CURLOPT_CONNECTTIMEOUT, which limit the connection time to a server.
CURLOPT_TIMEOUT (used up to now) is a timeout on any connection:
for instance transferring a big patch can be interrupted by such limit.

So this patch uses CURLOPT_CONNECTTIMEOUT instead of CURLOPT_TIMEOUT.

1 patch for repository http://darcs.net:

Fri Feb 22 00:43:25 CET 2013  Guillaume Hoffmann <guillaumh@gmail.com>
  * correctly set curl connection timeout
Attachments
msg16718 (view) Author: gh Date: 2013-02-22.10:10:58
An extra patch so that we get the debug message that DARCS_CONNECTION_TIMEOUT
is not a number earlier (even before we can actually download a remote file).

I wonder if this warning would occur earlier in the code, at the haskell level?
Is it slow to call getEnv(ironment)?

Also, another patch that sets this timeout to 1 second un the test
issue1599-automatically-expire-unused-caches.sh .

3 patches for repository http://darcs.net:

Thu Feb 21 23:37:32 CET 2013  Guillaume Hoffmann <guillaumh@gmail.com>
  * set timeout to 1 second in expire-unused-caches test

Fri Feb 22 00:43:25 CET 2013  Guillaume Hoffmann <guillaumh@gmail.com>
  * correctly set curl connection timeout

Fri Feb 22 11:07:21 CET 2013  Guillaume Hoffmann <guillaumh@gmail.com>
  * warn earlier when DARCS_CONNECTION_TIMEOUT is not a number
Attachments
msg16719 (view) Author: gh Date: 2013-02-22.10:20:39
Without conflicts.

3 patches for repository http://darcs.net:

Fri Feb 22 00:43:25 CET 2013  Guillaume Hoffmann <guillaumh@gmail.com>
  * correctly set curl connection timeout

Fri Feb 22 11:07:21 CET 2013  Guillaume Hoffmann <guillaumh@gmail.com>
  * warn earlier when DARCS_CONNECTION_TIMEOUT is not a number

Fri Feb 22 11:16:34 CET 2013  Guillaume Hoffmann <guillaumh@gmail.com>
  * set timeout to 1 second in expire-unused-caches test
Attachments
msg16782 (view) Author: gh Date: 2013-04-25.21:51:36
Self-accepting.
History
Date User Action Args
2013-02-21 23:49:01ghcreate
2013-02-22 10:10:58ghsetfiles: + patch-preview.txt, set-timeout-to-1-second-in-expire_unused_caches-test.dpatch, unnamed
messages: + msg16718
2013-02-22 10:20:39ghsetfiles: + patch-preview.txt, correctly-set-curl-connection-timeout.dpatch, unnamed
messages: + msg16719
2013-02-22 10:29:25ghsetstatus: needs-screening -> needs-review
2013-04-25 21:51:36ghsetstatus: needs-review -> accepted
messages: + msg16782