mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
BUG/MINOR: debug: make sure the "debug dev sched" tasks don't block stopping
When "debug dev sched" is used to pop up background tasks, these tasks are never stopped, so we must be careful to stop them when the stopping flag is set, otherwise they can prevent the process from stopping when sufficiently numerous (tests went as far as 100 million tasks, leading the run queue never being completely purged in one poll round). No backport is needed since this is only used when debugging and tuning the scheduler.
This commit is contained in:
parent
6765a32eb4
commit
8d63dc50ab
@ -1520,6 +1520,9 @@ static struct task *debug_task_handler(struct task *t, void *ctx, unsigned int s
|
||||
unsigned long inter = tctx[1];
|
||||
unsigned long rnd;
|
||||
|
||||
if (stopping)
|
||||
return NULL;
|
||||
|
||||
t->expire = tick_add(now_ms, inter);
|
||||
|
||||
/* half of the calls will wake up another entry */
|
||||
@ -1543,6 +1546,9 @@ static struct task *debug_tasklet_handler(struct task *t, void *ctx, unsigned in
|
||||
unsigned long rnd;
|
||||
int i;
|
||||
|
||||
if (stopping)
|
||||
return NULL;
|
||||
|
||||
/* wake up two random entries */
|
||||
for (i = 0; i < 2; i++) {
|
||||
rnd = statistical_prng() % tctx[0];
|
||||
|
Loading…
Reference in New Issue
Block a user