[Koha-bugs] [Bug 33898] background_jobs_worker.pl may leave defunct children processes for extended periods of time

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Jul 10 03:08:44 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33898

--- Comment #6 from David Cook <dcook at prosentient.com.au> ---
(In reply to Marcel de Rooy from comment #5)
> You did not see
> https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32558#c36 btw?
> 
> Signal handlers are not the most elegant way to address problems. Inherited
> by children too, altough no big deal here (not the pending signals).
> P::F allows you to define a run_on_finish callback. Could that be used?

I agree that signal handlers aren't the way to go.

It looks like run_on_finish is called via wait_all_children, so probably won't
work in this case.

An alternative could be to add a timeout (e.g. 10 seconds) to
$conn->receive_frame, and to call $pm->reap_finished_children() if it returns
undef (before calling next()).

That would be pretty lightweight, since receive_frame is just calling the
can_read () on the select loop.

In effect, it's doing a 10 second sleep which can be interrupted by an incoming
frame. 

An incoming frame reaps via start(), or we'd reap after that timeout sleep. 

That should do the trick.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list