150-force_fork_slow.patch 741 B

123456789101112131415161718192021
  1. --- a/workers/worker_fork.c
  2. +++ b/workers/worker_fork.c
  3. @@ -396,7 +396,7 @@ static int worker_fork_process(void *in_
  4. worker_fork_update_children(ctx);
  5. child = NULL;
  6. - for (i = 0; i < ctx->children_count; i++) {
  7. + for (i = 0; i < ctx->children_count && i < ctx->max_children; i++) {
  8. if (ctx->children[i]->busy == 0) {
  9. child = ctx->children[i];
  10. break;
  11. @@ -426,7 +426,8 @@ static int worker_fork_process(void *in_
  12. /*
  13. * We have to fork off a new child.
  14. */
  15. - if (ctx->children_count < ctx->max_children)
  16. + if (ctx->children_count < ctx->max_children ||
  17. + (ruleset_flags(&ctx->settings->rules, uevent) & FLAG_SLOW))
  18. child = worker_fork_spawn(ctx);
  19. for (i = 0; i < uevent->env_vars_c; i++) {