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

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.

Replies are listed 'Best First'.
Re^8: mod_perl, prefork mpm and alarms
by talexb (Chancellor) on Nov 30, 2006 at 18:11 UTC

    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

      I think you just need to untie STDIN. See this thread for examples.

        For those interested, the fix that perrin refers to above is as follows:

          Found this somewhere back when this bug first appeared in mod_perl:

          # work-around for mod_perl my $tie_stdin = tied *STDIN; untie *STDIN if $tie_stdin; # insert open2() or open3() statement after the above

          Gerald,

          It is a mod_perl bug, but I would consider putting it in the FAQ. Would probably be very helpful to people.

        I started work on converting the existing code to use IPC::Run, but hadn't finished by the end of the day today .. so I may put that on hold and try this fix instead.

        ++beer!

        Alex / talexb / Toronto

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

        Update: Added clarification in first paragraph as to the source of the fix.

        Well, just tried this fix, and it didn't change the error that pops out.

        I'm still getting

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

        FWIW, STDIN was defined when I unTIEd it, but it made no difference to the behaviour.

        I'll go back to working on the IPC::Run approach now.

        Alex / talexb / Toronto

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