You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although, this isn't a bug in libcurl, but in my case I had to fix the issue. It seems that libcurl without c-ares always starts a thread for dns requests since dns was always blocking before Win8. Starting from Win8 there is a non-blocking version is available with GetAddrInfoExW.
Alternatively, libcurl could have cached failed dns results for a very short time to avoid redoing the same requests multiple times: for example, if 1000 requests are made to the same host while there is no connection instead of starting 1000 threads in 10ms doing the same failing dns request it would be better to cache failures for 10ms or 1ms.
I did this
I tried to run a test on Windows under asan where many fetches are tried when there is no internet. It appears that starting/exiting threads under asan leaks memory badly, it takes only a few seconds before all ram gets consumed.
I expected the following
Although, this isn't a bug in libcurl, but in my case I had to fix the issue. It seems that libcurl without c-ares always starts a thread for dns requests since dns was always blocking before Win8. Starting from Win8 there is a non-blocking version is available with GetAddrInfoExW.
Alternatively, libcurl could have cached failed dns results for a very short time to avoid redoing the same requests multiple times: for example, if 1000 requests are made to the same host while there is no connection instead of starting 1000 threads in 10ms doing the same failing dns request it would be better to cache failures for 10ms or 1ms.
In my case, I ended up writing code that uses GetAddrInfoExW on Win8. Let me know if it's something worth to add to libcurl, and I'll make a PR.
curl/libcurl version
curl 8.5.0
operating system
WIndows 8+
The text was updated successfully, but these errors were encountered: