-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
major performance regression in librepo after upgrade to libcurl-7.61.1 #2948
Comments
Tricky. The commit you refer to fixed a real bug. Before that, easy handles could be left in the list splay tree for timeouts even though the transfer had indeed ended and should've been removed. But fixing that bug caused some subtle changes in what curl_multi_timeout() could still return -1 even before this fix, for example before any handles were added and similar. It was just more rare. Timeout value 0 means run again straight away and that was clearly not the right thing for that situation. However, I don't see the problem you mention in multi-app.c? This example doesn't do the 100ms sleep based on the timeout value, it does it based on the maxfd returned from |
Indeed. The code of I changed the example to download This could be fixed in the example by using a
However, people often base their code on the examples distributed with libcurl. So the mentioned change might have broken more libcurl-based software than just librepo. |
Actually, it was commit acefdd0 what landed in the master branch (I was referring to an obsolete PR commit by mistake). |
We really should do that fix, yes. As a matter of fact I think it would make sense to take this as an opportunity and go through the examples with a comb and make sure that they actually are using the API the way we want them to and the way the API is documented to work... It is very unfortunate when our own examples mislead users. |
See curl/curl#2948 for details.
See curl/curl#2948 for details.
I am not sure about |
Would it be fair to say that this issue just affects libcurl users that are using libcurl as their "main loop", as opposed to integrating with an external mainloop (e.g. glib)? librepo does the former, where as e.g. libostree does the latter. |
This is a documentation issue. Some of the examples distributed with libcurl used to use its API in a wrong way. The code of librepo was based on those examples, which triggered a problem later on. The code you refer to does not seem to be based on the same examples, so it is unrelated to this issue. Are you experiencing any performance regression in libostree after upgrade to libcurl-7.61.1? |
….9.2 commit 313a7644d03f9657ee0c7aa747d1db260f8e2fc0 Author: Jaroslav Mracek <jmracek@redhat.com> Date: Tue Sep 25 14:04:26 2018 +0200 Release 1.9.2 commit 420e78d8b7bb69d3041630bc4b901917d101d9ba Author: Kamil Dudka <kdudka@redhat.com> Date: Fri Sep 7 14:53:23 2018 +0200 fix major performance regression with libcurl-7.61.1 See curl/curl#2948 for details.
Commit caa4efb causes a severe performance regression in librepo code. The dnf test-suite took 1.8s to complete before the patch but now it takes 96s to complete. The reason is that
curl_multi_timeout()
now returns -1 if there are no transfers running whereas it returned 0 before the mentioned patch. Consequently, librepo callsselect()
to sleep for 1s whenever all transfers complete before the call tocurl_multi_timeout()
. The code in question is available here:https://github.com/rpm-software-management/librepo/blob/7f147258b61b607ae2e311e6ffb57830bc6be27c/librepo/downloader.c#L1874
My original impression was that this is a bug of librepo as they should not call
curl_multi_timeout()
at all whencurl_multi_perform()
returnsstill_running == 0
. However, then I realized that their code is heavily based on the following libcurl example, which does exactly the same thing:curl/docs/examples/multi-app.c
Line 74 in 6987fce
The text was updated successfully, but these errors were encountered: