[Koha-bugs] [Bug 20342] Fix table locking issue, progress bar not updating, and allow use of plack for Stage MARC Import

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Oct 30 02:04:48 CET 2020


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

--- Comment #22 from David Cook <dcook at prosentient.com.au> ---
(In reply to David Cook from comment #21)
> In theory, if $SIG{CHLD} were set to IGNORE rather than DEFAULT, then we
> possibly wouldn't get zombie processes, but that would need to be set at a
> higher level than stage-marc-import.pl I reckon, plus it's not a brilliant
> idea, as it would have wider consequences.
> 
> --
> 
> Looking at https://metacpan.org/pod/CGI::Compile#exit-and-exceptions, I see
> that exit() isn't a real exit as well... makes sense. 
> 
> If we use CORE::exit(0) instead of exit(0), it actually exits the background
> child process, although we still wind up with the zombie process like so:

So if I use CORE::exit(0) in stage-marc-import.pl and $SIG{CHLD} = 'IGNORE' in
/etc/koha/sites/kohadev/plack.psgi, then I don't get a zombie process. 

But... I really don't think this is a great idea, although I'm not seeing any
explicit web usage of wait/waitpid...

https://docstore.mik.ua/orelly/perl/cookbook/ch16_20.htm makes me think we
should be more careful.

I think the best bet is to have this be a proper background task where
stage-marc-import.pl is responsible only for the file upload, and then it
enqueues a background task with RabbitMQ to let a background worker deal with
the actual work.

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


More information about the Koha-bugs mailing list