in reply to Re^4: mod_perl, prefork mpm and alarms
in thread mod_perl, prefork mpm and alarms

Something other than your script is setting an alarm? Maybe you should show us the code you use to call ghostscript. The above trace looks more like a problem with pipes to me.

Replies are listed 'Best First'.
Re^6: mod_perl, prefork mpm and alarms
by talexb (Chancellor) on Nov 29, 2006 at 20:54 UTC

    I owe you a beer. You're absolutely right .. the code that I'm calling does do some futzing around with pipes to call Ghostscript .. it's not my code, I'm just calling it, but I should have guessed (or even checked) that there were pipes involved.

    And that's not on .. Apache has taken control of the input and output pipes in the main process .. meaning if I want to do something *like* that, I have to start a sub-process and talk to it directly. So Apache was burping when it saw the code I was calling start to rearrange the plumbing, I guess.

    Well, it's going to get tricky later when I want to start a sub-process if one isn't yet running for a document, use it for a page image, and then leave it in place for subsequent requests for the same document.

    But Momma, that's where the fun is! --Manfred Mann

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      STDIN and STDOUT are tied under mod_perl, but you should be able to open pipes to another process. Usually, the best way to handle this kind of thing is a separate job queue process, as suggested by some others.

        Just posting here for sake of completeness .. after plugging Log::Log4perl in various places, I discovered the fatal error was

        Can't locate object method "FILENO" via package "Apache::RequestRec" at /usr/lib/perl5/5.8.0/IPC/Open3.pm line 196

        So that means I need to figure out how to solve that problem .. but at least I know what problem I'm trying to solve now.

        Alex / talexb / Toronto

        "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds