Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curl exceeds max-time when retries enabled #8877

Closed
Nuru opened this issue May 19, 2022 · 1 comment
Closed

curl exceeds max-time when retries enabled #8877

Nuru opened this issue May 19, 2022 · 1 comment

Comments

@Nuru
Copy link

@Nuru Nuru commented May 19, 2022

I did this

$ time curl --max-time 10 --retry 5 --retry-connrefused https://BD71190E2FE991E56354DF0200B85B61.gr7.us-east-1.eks.amazonaws.com
curl: (28) Failed to connect to BD71190E2FE991E56354DF0200B85B61.gr7.us-east-1.eks.amazonaws.com port 443: Connection timed out
Warning: Problem : timeout. Will retry in 1 seconds. 5 retries left.
curl: (28) Failed to connect to BD71190E2FE991E56354DF0200B85B61.gr7.us-east-1.eks.amazonaws.com port 443: Connection timed out
Warning: Problem : timeout. Will retry in 2 seconds. 4 retries left.
curl: (28) Failed to connect to BD71190E2FE991E56354DF0200B85B61.gr7.us-east-1.eks.amazonaws.com port 443: Connection timed out
Warning: Problem : timeout. Will retry in 4 seconds. 3 retries left.
curl: (28) Failed to connect to BD71190E2FE991E56354DF0200B85B61.gr7.us-east-1.eks.amazonaws.com port 443: Connection timed out
Warning: Problem : timeout. Will retry in 8 seconds. 2 retries left.
curl: (28) Failed to connect to BD71190E2FE991E56354DF0200B85B61.gr7.us-east-1.eks.amazonaws.com port 443: Connection timed out
Warning: Problem : timeout. Will retry in 16 seconds. 1 retries left.
curl: (28) Failed to connect to BD71190E2FE991E56354DF0200B85B61.gr7.us-east-1.eks.amazonaws.com port 443: Connection timed out

real	1m16.354s
user	0m0.012s
sys	0m0.010s

I expected the following

I expected curl to quit after 10 seconds. Note that not only did it not quit after 10 seconds, it did not even quit after the retry delay backed off to something greater than 10 seconds.

curl/libcurl version

Current version for Debian 11.3:

curl 7.74.0 (x86_64-pc-linux-gnu) libcurl/7.74.0 OpenSSL/1.1.1n zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.43.0 librtmp/2.3
Release-Date: 2020-12-09
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

operating system

Debian 11.3
Linux 8024f36bbeba 5.10.104-linuxkit #1 SMP Thu Mar 17 17:08:06 UTC 2022 x86_64 GNU/Linux

jay added a commit to jay/curl that referenced this issue May 19, 2022
Prior to this change the doc said --max-time set the maximum time of the
'whole operation' which is not accurate. The option maps to
CURLOPT_TIMEOUT_MS which sets maximum transfer time.

For example, the maximum time on a transfer is reset if the transfer is
retried (--retry).

Reported-by: Nuru@users.noreply.github.com

Fixes curl#8877
Closes #xxxx
@jay
Copy link
Member

@jay jay commented May 19, 2022

Use --retry-max-time. I've proposed a change to clarify, see #8879.

jay added a commit to jay/curl that referenced this issue May 19, 2022
Prior to this change the doc said --max-time set the maximum time of the
'whole operation' which is not accurate. The option maps to
CURLOPT_TIMEOUT_MS which sets maximum transfer time.

For example, the maximum time on a transfer is reset if the transfer is
retried (--retry).

Reported-by: Nuru@users.noreply.github.com

Fixes curl#8877
Closes #xxxx
@bagder bagder closed this as completed in 64641d2 May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants