Bugzilla – Attachment 151994 Details for
Bug 33898
background_jobs_worker.pl may leave defunct children processes for extended periods of time
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33898: background_jobs_worker.pl may leave defunct children processes for extended periods of time
Bug-33898-backgroundjobsworkerpl-may-leave-defunct.patch (text/plain), 1.77 KB, created by
Kyle M Hall (khall)
on 2023-06-05 14:49:14 UTC
(
hide
)
Description:
Bug 33898: background_jobs_worker.pl may leave defunct children processes for extended periods of time
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-06-05 14:49:14 UTC
Size:
1.77 KB
patch
obsolete
>From 0eb77ff511a445b8229d979caf513abead9a9f3e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 5 Jun 2023 10:34:46 -0400 >Subject: [PATCH] Bug 33898: background_jobs_worker.pl may leave defunct > children processes for extended periods of time > >It appears that the background jobs worker can leave defunct processes for periods of time. Though it is mostly harmless, it would be nice if that did not happen. Children are reaped automatically when start or wait_all_children are called. We only call start when a new job is found, and wait_all_children after exiting our while loop. The solution is to simply call reap_all_children after we sleep. This is a non-blocking call that will clean up those defunct processes. > >Test Plan: >1) Disable Rabbit >2) Set background_jobs_worker/max_processes to something like 5 >3) Restart all the things! >4) Run a bunch of elastic index updates >5) Verify you have defunct processes >6) Apply this patch >7) Run more elastic index updates >8) Defunct processes should disappear every 10 seconds or so! > >If you do not see defunct processes, the test plan is to simply verify >everything continues to work as expected. >--- > misc/workers/background_jobs_worker.pl | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/misc/workers/background_jobs_worker.pl b/misc/workers/background_jobs_worker.pl >index c54610458f..6a12c3673f 100755 >--- a/misc/workers/background_jobs_worker.pl >+++ b/misc/workers/background_jobs_worker.pl >@@ -92,6 +92,12 @@ try { > > my $pm = Parallel::ForkManager->new($max_processes); > >+$SIG{ALRM} = sub { >+ $pm->reap_finished_children(); >+ alarm(5); >+}; >+alarm(5); >+ > if ( $conn ) { > # FIXME cf note in Koha::BackgroundJob about $namespace > my $namespace = C4::Context->config('memcached_namespace'); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33898
:
151993
|
151994
|
151997
|
153194
|
162941
|
162942
|
162943
|
162944
|
162953
|
162954
|
163056
|
163057