commit e13e2012b9d1bbde73bea22d9fd13fb0b88c04de
parent 327bb0e2ca72dd57bd1ceb9c05dd90dfffcc92a5
Author: David Goulet <dgoulet@torproject.org>
Date: Thu, 23 May 2019 09:40:07 -0400
Merge branch 'tor-github/pr/1034'
Diffstat:
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/changes/ticket29617 b/changes/ticket29617
@@ -0,0 +1,4 @@
+ o Minor bugfixes (out-of-memory handler):
+ - When purging the DNS cache because of an out-of-memory condition,
+ try purging just the older entries at first. Previously, we would
+ purge the whole thing. Fixes bug 29617; bugfix on 0.3.5.1-alpha.
diff --git a/src/feature/relay/dns.c b/src/feature/relay/dns.c
@@ -2187,7 +2187,8 @@ dns_cache_handle_oom(time_t now, size_t min_remove_bytes)
current_size -= bytes_removed;
total_bytes_removed += bytes_removed;
- time_inc += 3600; /* Increase time_inc by 1 hour. */
+ /* Increase time_inc by a reasonable fraction. */
+ time_inc += (MAX_DNS_TTL_AT_EXIT / 4);
} while (total_bytes_removed < min_remove_bytes);
return total_bytes_removed;