sduggal has asked for the wisdom of the Perl Monks concerning the following question:

Mojolicious version: 7.24

Perl version: ActivePerl 5.22

Operating system: Windows Server 2008

Steps to reproduce the behavior

Inconsistency: Daemon web server unexpectedly goes to sleep (stops responding once in a while) and only becomes active on key press in its command window. The issue is not reproducible in a consistent manner or with a specific set of steps. It just happens sometimes.

Expected behavior

The server once started should always remain responsive Actual behavior

Daemon web server in the command window unexpectedly goes to sleep (stops responding once in a day). It just happens sometimes and needs a key press in the command window to continue processing

I use the following command to start the server: perl.exe ez_brochure_web daemon -i 0 I tried -m option but it has no effect, the issue still ocuurs at times.

Please help if you have seen anything similar.

Replies are listed 'Best First'.
Re: Mojolicious Daemon server issue
by marto (Cardinal) on Mar 09, 2017 at 13:08 UTC

    Can you re test with the latest release v7.28 and try to replicate your issue? Failing that try tracing what's going on with the sysinternals suite. At work a stupid AV policy runs daily, even on files which have not changed. For some things this causes the AV software to max out one CPU core and the app seems to freeze for this time.

Re: Mojolicious Daemon server issue
by choroba (Cardinal) on Mar 09, 2017 at 12:38 UTC
    What happens if you run the daemon without a command window?

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
Re: Mojolicious Daemon server issue
by Anonymous Monk on Mar 09, 2017 at 12:40 UTC
    Is the mouse involved? What happens if you launch the daemon in a background process?
Re: Mojolicious Daemon server issue
by huck (Prior) on Mar 09, 2017 at 21:33 UTC

    and only becomes active on key press in its command window.

    To me this stinks of something trying to read from STDIN or the raw tty. To have it running in a command window implies to me you are starting it via that same window. Lets assume you start it by typing Daemonwebserver and pressing enter. Try instead saying Daemonwebserver<NUL if you are on windows or Daemonwebserver</dev/null on unix, (being current apples are unixish i suspect that would work there too). (edit i dont know how i missed this perl.exe ez_brochure_web daemon -i 0) Try starting it by saying perl.exe ez_brochure_web daemon -i 0<NUL. If the problem then goes away look thru your code of ez_brochure_web for where it might try to read from <STDIN> or maybe just <>. If it doesnt go away i suspect something is trying to read from the raw device, bypassing STDIN. that could be harder to find, but at least you have a clue what to look for.

Re: Mojolicious Daemon server issue
by Anonymous Monk on Mar 09, 2017 at 21:56 UTC
    Mojolicious version: 7.24 CORRECT!

    Perl version: ActivePerl 5.22 WRONG!

    Operating system: Windows Server 2008 WRONG!

    What is wrong with you people? Download Oracle Box. It's free. Download a Linux distro. It's free. Stop doing stupid things. Those are not free.

      I would have followed this advice if I had a choice. Actually migrated a citrix desktop application (VBA) into Perl Web framework. This app has several third party windows software as dependency. Hence this limitation.