Move the task creation into cache_create_db()
The dns_cache_flush() drops the old database and creates a new one, but it forgets to create the task(s) that runs the node pruning and cleaning the rbtdb when flushing it next time. This causes the cleaning to skip cleaning the parent nodes (with .down == NULL) leading to increased memory usage over time until the database is unable to keep up and just stays overmem all the time.
This commit is contained in:
@@ -61,25 +61,20 @@ dns_cache_create(isc_mem_t *cmctx, isc_mem_t *hmctx, isc_taskmgr_t *taskmgr,
|
||||
const char *cachename, const char *db_type,
|
||||
unsigned int db_argc, char **db_argv, dns_cache_t **cachep);
|
||||
/*%<
|
||||
* Create a new DNS cache.
|
||||
*
|
||||
* dns_cache_create2() will create a named cache.
|
||||
*
|
||||
* dns_cache_create3() will create a named cache using two separate memory
|
||||
* contexts, one for cache data which can be cleaned and a separate one for
|
||||
* memory allocated for the heap (which can grow without an upper limit and
|
||||
* has no mechanism for shrinking).
|
||||
*
|
||||
* dns_cache_create() is a backward compatible version that internally
|
||||
* specifies an empty cache name and a single memory context.
|
||||
* Create a new named DNS cache using two separate memory contexts, one for
|
||||
* cache data which can be cleaned and a separate one for memory allocated for
|
||||
* the heap (which can grow without an upper limit and has no mechanism for
|
||||
* shrinking).
|
||||
*
|
||||
* Requires:
|
||||
*
|
||||
*\li 'cmctx' (and 'hmctx' if applicable) is a valid memory context.
|
||||
*\li 'cmctx' and 'hmctx' are valid memory contexts.
|
||||
*
|
||||
*\li 'taskmgr' is a valid task manager (if 'db_type' is "rbt").
|
||||
*
|
||||
*\li 'taskmgr' is a valid task manager and 'timermgr' is a valid timer
|
||||
* manager, or both are NULL. If NULL, no periodic cleaning of the
|
||||
* cache will take place.
|
||||
* manager, or both are NULL (if 'db_type' is not "rbt"). If NULL, no
|
||||
* periodic cleaning of the cache will take place.
|
||||
*
|
||||
*\li 'cachename' is a valid string. This must not be NULL.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user