Heavy use of a DNS entry by multiple threads can prevent it from being ejected from the cache, even after its timeout has been exceeded. This patch attached fixes this issue.
The patch allows a DNS entry to persist outside of the hash cache and be released when the last connection referencing it calls Curl_resolv_unlock.
It also changes the hash abstraction to replace an entry with a new one by default rather than favoring older entries. I checked the other use of the hash abstraction in multi.c and it already assumes that the insert will either succeed or return NULL -- not that it will return the old element.
I've also added some debugging code that helps catch reference leaks. After curl_easy_cleanup() is called on all extant handles, curl_get_ndns() should return 0.
Daniel Stenberg
name resolving/DNS
bad behaviour
Public
|
Date: 2009-11-11 09:32:18 UTC Thanks for the report, this problem is now fixed in CVS! |
|
Date: 2009-11-07 00:34:03 UTC New version of patch should address your concerns. Some more code cleanup |
|
Date: 2009-11-06 22:29:31 UTC Thanks a lot. This seems like a good idea. |
| Filename | Description | Download |
|---|---|---|
| dns-cache.diff | Patch to fix problem | Download |
| dns-cache2.diff | Improved comments | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2009-11-11 09:32:19 UTC | bagder |
| resolution_id | None | 2009-11-11 09:32:19 UTC | bagder |
| allow_comments | 1 | 2009-11-11 09:32:19 UTC | bagder |
| close_date | - | 2009-11-11 09:32:19 UTC | bagder |
| File Added | 349862: dns-cache2.diff | 2009-11-07 00:32:13 UTC | csapuntz |
| priority | 5 | 2009-11-06 22:29:32 UTC | bagder |
| File Added | 349443: dns-cache.diff | 2009-11-04 01:07:46 UTC | csapuntz |