All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/3] Config.in: timeout earlier when connecting to download servers
Date: Tue, 04 Feb 2025 11:56:37 +0100	[thread overview]
Message-ID: <8734guou56.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <fcd979d6868b3f34a4392bad6e7c3bdb100ce83f.1738575233.git.yann.morin.1998@free.fr> (Yann E. MORIN's message of "Mon, 3 Feb 2025 10:34:06 +0100")

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Some sites have broken DNS entries where some A or AAAA records point
 > to a nonexistent machine. This causes a long delay (~135sec here) before
 > a fallback to another IP is attempted. This is the case for example for
 > sigrok.org, which IPv6 entry is not reachable (at least from the few
 > locations I have access to, while other IPv6 servers are reachable).

 > Add a relatively small timeout on connect for the few download backends
 > where we can easily drive that setting:

 >   - for curl and wget, that timeout only applies when establishing the
 >     TCP connection, i.e. the three-way handshake;
 >   - for scp and sftp, that timeout also include the ssh handshake;
 >   - for svn, it is not explicit what the timeout is about, but the
 >     documentation states "Timeout for HTTP requests in seconds".

 > In modern times, we expect that we can indeed establish those handshakes
 > in less than 10s; anything taking longer is in practice an unreachable
 > site...

 > For other download mechanism (bzr, cvs, git, hg), as well as
 > post-processing helpers (cargo, go), it does not seem possible to set
 > such a timeout.

 > Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
 > ---
 >  Config.in | 10 +++++-----
 >  1 file changed, 5 insertions(+), 5 deletions(-)

 > diff --git a/Config.in b/Config.in
 > index c0c1a6079d..a543091d4f 100644
 > --- a/Config.in
 > +++ b/Config.in
 > @@ -114,15 +114,15 @@ menu "Commands"
 
 >  config BR2_CURL
 >  	string "Curl command"
 > -	default "curl -q --ftp-pasv --retry 3"
 > +	default "curl -q --ftp-pasv --retry 3 --connect-timeout 10"

It doesn't seem to be strictly needed for curl as it seems to use the
happy eyeballs algorithm, but OK:
time curl -v http://sigrok.org
*   Trying [2a05:bec0:20:c01::8c96:bda6]:80...
*   Trying 134.255.237.124:80...
* Connected to sigrok.org (134.255.237.124) port 80 (#0)
> GET / HTTP/1.1
> Host: sigrok.org
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 04 Feb 2025 10:56:28 GMT
< Server: Apache/2.4.56
< X-Content-Type-Options: nosniff
< Vary: Accept-Encoding,Cookie
< Expires: Tue, 04 Feb 2025 10:56:28 GMT
< Cache-Control: private, must-revalidate, max-age=0
< Last-Modified: Tue, 04 Feb 2025 10:56:28 GMT
< Location: https://sigrok.org/wiki/Main_Page
< X-Request-Id: e50b7132460e1a6484be9312
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=utf-8
<
* Connection #0 to host sigrok.org left intact

real    0m0.249s
user    0m0.007s
sys     0m0.011s


Committed, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2025-02-04 10:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03  9:34 [Buildroot] [PATCH 0/3] package/sigrok: update and udev rules (branch yem/sigrok) Yann E. MORIN
2025-02-03  9:34 ` [Buildroot] [PATCH 1/3] Config.in: timeout earlier when connecting to download servers Yann E. MORIN
2025-02-04 10:56   ` Peter Korsgaard [this message]
2025-02-04 20:08     ` Yann E. MORIN
2025-02-03  9:34 ` [Buildroot] [PATCH 2/3] package/libserialport: update to 0.1.2 Yann E. MORIN
2025-02-04  9:46   ` Peter Korsgaard
2025-02-03  9:34 ` [Buildroot] [PATCH 3/3] package/libsigrok: install udev rules Yann E. MORIN
2025-02-04  9:46   ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734guou56.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.com \
    --cc=buildroot@buildroot.org \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.