Bug 1756400 - No affect of CURLOPT_DNS_CACHE_TIMEOUT, CURLOPT_DNS_SHUFFLE_ADDRESSES with CURL multi handle
Summary: No affect of CURLOPT_DNS_CACHE_TIMEOUT, CURLOPT_DNS_SHUFFLE_ADDRESSES with CU...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: curl
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1741931
TreeView+ depends on / blocked
 
Reported: 2019-09-27 14:35 UTC by Jaroslav Mracek
Modified: 2023-09-14 05:43 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-05-26 14:32:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
attempt to reproduce (4.06 KB, text/plain)
2019-09-30 12:48 UTC, Kamil Dudka
no flags Details

Description Jaroslav Mracek 2019-09-27 14:35:16 UTC
Description of problem:
With CURL multi handle setting curl_easy_setopt() setting CURLOPT_DNS_CACHE_TIMEOUT, CURLOPT_DNS_SHUFFLE_ADDRESSES has no effect on IPused.

Version-Release number of selected component (if applicable):
curl-7.65.3-4.fc30.x86_64

How reproducible:
With https://github.com/rpm-software-management/librepo/pull/169 librepo starts to report IP. When repo has broken metalink like `metalink=https://mirrors.fedoraproject.org/metalinks?repo=updates-released-f$releasever&arch=$basearch` there will be for independent connection that uses same IP.

To resolve the issue it requires to create new multihandle.

Expected result:
With multi handle, provide a way how to move first IP in the list from DNS to the last position, or allow CURLOPT_DNS_CACHE_TIMEOUT with '0' to redownload list of IPs from DNS. 

Related issue: https://bugzilla.redhat.com/show_bug.cgi?id=1741931

Comment 1 Kamil Dudka 2019-09-30 12:48:23 UTC
Created attachment 1621135 [details]
attempt to reproduce

... based on /usr/share/doc/libcurl-devel/multi-double.c

Comment 2 Kamil Dudka 2019-09-30 12:53:01 UTC
I cannot confirm your hypothesis.  I created a test program based on /usr/share/doc/libcurl-devel/multi-double.c and it seems to work as expected.  It reuses the cached IP address by default but it uses 2 distinct IP addresses with CURLOPT_DNS_CACHE_TIMEOUT set to 0.

Default behavior:

* Found bundle for host mirrors.fedoraproject.org: 0x568e80 [serially]
* Server doesn't support multiplex (yet)
* Connection #0 is still name resolving, can't reuse
*   Trying 67.219.144.68:443...
* TCP_NODELAY set
* Hostname 'mirrors.fedoraproject.org' was found in DNS cache
*   Trying 67.219.144.68:443...
* TCP_NODELAY set
* Connected to mirrors.fedoraproject.org (67.219.144.68) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* Connected to mirrors.fedoraproject.org (67.219.144.68) port 443 (#1)
[...]


With CURLOPT_DNS_CACHE_TIMEOUT set to 0:

* Found bundle for host mirrors.fedoraproject.org: 0x204ce80 [serially]
* Server doesn't support multiplex (yet)
* Connection #0 is still name resolving, can't reuse
*   Trying 152.19.134.198:443...
* TCP_NODELAY set
* Hostname in DNS cache was stale, zapped
*   Trying 209.132.181.15:443...
* TCP_NODELAY set
* Connected to mirrors.fedoraproject.org (152.19.134.198) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* Connected to mirrors.fedoraproject.org (209.132.181.15) port 443 (#1)

Comment 3 Jaroslav Mracek 2019-10-07 18:45:26 UTC
We have a different workflow. The second download is created and perform when the fist one failed. I will try to provide detailed data from librepo/downloader.c module.

Comment 4 Kamil Dudka 2019-10-08 07:35:50 UTC
Once you have the data, could you please modify attachment #1621135 [details] such that it reproduces the problem?

Comment 5 Ben Cotton 2019-10-31 18:47:16 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Ben Cotton 2020-04-30 20:45:41 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Ben Cotton 2020-05-26 14:32:49 UTC
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 8 Red Hat Bugzilla 2023-09-14 05:43:51 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.