[Koha-bugs] [Bug 8970] MARC import gives error under Starman/Plack

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Apr 24 04:18:02 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8970

--- Comment #21 from Robin Sheat <robin at catalyst.net.nz> ---
(In reply to Jonathan Druart from comment #19)
> Julian used Net::Server::Daemonize to fix an other issue in
> tools/batchMod.pl. It is in production and it seems to work quite well.
> 
> see
> http://git.biblibre.com/?p=koha;a=commit;
> h=1347281752d62dd370f6e4fae936def6d7630d5c

I'm not sure that method would be totally safe, for the same reason that our
current one has issues. Things like carrying the database handles around. I
also don't like the idea of daemonising a starman process, it just seems
dangerous.

(In reply to Jacek Ablewicz from comment #20)
> Looks like the plack/mod_perl related pitfall, when 2+ concurrently running
> processes are sharing the same single DBI connection (a big no-no, DBI would
> not work reliably if used that way). But - reading previous comments in this

I thought about it a bit more, and realised why this was all of a sudden a
problem: under CGI, the parent process ended immediately, so the child had the
DBI handle all to itself. Now, it doesn't end immediately, and so next time it
gets called on to do something, it's using the handle that is being used to do
the import.

> report, there may be some other unrelated/additional problems with
> background jobs under plack as well (?).

Maybe. I think it's OK, it's just that most of my failure to have it work is
that it required more RAM than I had allocated to the VM. If we don't have a
dedicated queuing daemon, there's no way around this. But I think a
fork-and-exec will do for now, splitting the functions out into either another
script, or changing the execution path so that it works just by execing itself.

> Forked/background jobs - and plack workers etc. - would not be as memory
> heavy (thanks to copy-on-write kernel feature) if we preload more C4/*,
> Koha/* and CPAN modules at plack startup script. But right now, preloading

That would be a good thing to do, though is a task for another bug.

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


More information about the Koha-bugs mailing list