]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix: dev: Fix isc_quota bug
authorArаm Sаrgsyаn <aram@isc.org>
Thu, 20 Feb 2025 12:19:46 +0000 (12:19 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Thu, 20 Feb 2025 12:19:46 +0000 (12:19 +0000)
Running jobs which were entered into the isc_quota queue is the
responsibility of the isc_quota_release() function, which, when
releasing a previously acquired quota, checks whether the queue
is empty, and if it's not, it runs a job from the queue without touching
the 'quota->used' counter. This mechanism is susceptible to a possible
hangup of a newly queued job in case when between the time a decision
has been made to queue it (because used >= max) and the time it was
actually queued, the last quota was released. Since there is no more
quotas to be released (unless arriving in the future), the newly
entered job will be stuck in the queue.

Fix the issue by adding checks in both isc_quota_release() and
isc_quota_acquire_cb() to make sure that the described hangup does
not happen. Also see code comments.

Closes #4965

Merge branch '4965-isc_quota-bug-fix' into 'main'

See merge request isc-projects/bind9!10082


Trivial merge