Skip to content

Refactor isc_ratelimiter API

Ondřej Surý requested to merge 3555-refactor-isc_ratelimiter-API into main

Because the dns_zonemgr_create() was run before the loopmgr was started, the isc_ratelimiter API was more complicated that it had to be. Move the dns_zonemgr_create() to run_server() task which is run on the main loop, and simplify the isc_ratelimiter API implementation.

The isc_timer is now created in the isc_ratelimiter_create() and starting the timer is now separate async task as is destroying the timer in case it's not launched from the loop it was created on. The ratelimiter tick now doesn't have to create and destroy timer logic and just stops the timer when there's no more work to do.

This should also solve all the races that were causing the isc_ratelimiter to be left dangling because the timer was stopped before the last reference would be detached.

Closes #3555 (closed)

Edited by Ondřej Surý

Merge request reports