Bugzilla – Attachment 162941 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.96 KB, created by
Victor Grousset/tuxayo
on 2024-03-08 06:03:31 UTC
(
hide
)
Description:
Bug 33898: background_jobs_worker.pl may leave defunct children processes for extended periods of time
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2024-03-08 06:03:31 UTC
Size:
1.96 KB
patch
obsolete
>From 665850f828747a49526c848b2266e6db14cc4de4 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. > >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> > Used Asymar's test plan from comment 12. (based on record import) >--- > 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 823dbab15c..b75df342e9 100755 >--- a/misc/workers/background_jobs_worker.pl >+++ b/misc/workers/background_jobs_worker.pl >@@ -99,6 +99,12 @@ try { > > my $pm = Parallel::ForkManager->new($max_processes); > >+$SIG{ALRM} = sub { >+ $pm->reap_finished_children(); >+ alarm(1); >+}; >+alarm(1); >+ > if ( $conn ) { > # FIXME cf note in Koha::BackgroundJob about $namespace > my $namespace = C4::Context->config('memcached_namespace'); >-- >2.44.0
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