mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
[9.18] fix: dev: Don't loop indefinitely when isc_task quantum is 'unlimited'
Don't run more events than already scheduled. If the quantum is set to a high value, the task_run() would execute already scheduled, and all new events that result from running event->ev_action(). Setting quantum to a number of scheduled events will postpone events scheduled after we enter the loop here to the next task_run() invocation. Merge branch 'ondrej/dont-run-more-events-than-scheduled-9.18' into 'bind-9.18' See merge request isc-projects/bind9!9257
This commit is contained in:
commit
674420df64
1 changed files with 12 additions and 0 deletions
|
|
@ -793,6 +793,18 @@ task_run(isc_task_t *task) {
|
|||
LOCK(&task->lock);
|
||||
quantum = task->quantum;
|
||||
|
||||
/*
|
||||
* Don't run more events than already scheduled. If the quantum is set
|
||||
* to a high value, the following code would execute already scheduled,
|
||||
* and all events that result from running event->ev_action(). Setting
|
||||
* quantum to a number of scheduled events will postpone events
|
||||
* scheduled after we enter the loop here to the next task_run()
|
||||
* invocation.
|
||||
*/
|
||||
if (quantum > task->nevents) {
|
||||
quantum = task->nevents;
|
||||
}
|
||||
|
||||
if (task->state != task_state_ready) {
|
||||
goto done;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue