cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: dns cache doesn't refresh entries while they are in use

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 20 Mar 2015 03:10:16 -0400

On 3/17/2015 7:14 AM, Stefan Bühler wrote:
> the dns cache doesn't refresh entries while they are in use, which can lead to really bad behavior: your requests time out because the service isn't available anymore, and you try them again (too fast or too many requests), and there is always at least one request using the entry, and it keeps looping...

Hi Stefan thanks for your work on this. I don't suppose there is an easy
way to reproduce the failure to refresh entries? Can you give us a step
by step example of how this may happen (or happened) to you? I assume
you had some easy handles in a multi handle?

> See https://github.com/tvbuehler/curl/commits/fix-dns-cache-refresh (especially the "fix refreshing of obsolete dns cache entries") for a possible fix, which also contains CURLOPT_RESOLVE related bug fixes.
>
> It would be nice to get feedback for this specific commit, and maybe for the others as well.

I read through it on github (right now on the web , I didn't compile the
changes yet) and I think they look good. The version I looked at is the
one where the refcount bug is fixed. The only thing that concerns me is
artifacts, like maybe there is somewhere in the code base that depends
on timestamp 0 meaning the entry is not in the cache (as it did prior to
your commit). I will check on that though.

As you know I'm working on the resolve removal and I rewrote that
function to handle individual removals. Your implementation is pretty
straightforward and I don't see a problem with it, but if my changes are
later accepted yours will end up being replaced.

If a maintainer adds your 3 commits I will rebase off your work. I
cannot add tests for your work though, I have enough to do with what I'm
working on.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-03-20