Hi,

I have an psgi app and I want to have a mule which will perform periodic housekeeping.

Straightforward approach, like:

$ uwsgi --http-socket :8080 -M --mule=mule.pl --psgi=psgi.pl

in general does what I want, but... the problem is that postfork()/atexit() hooks in psgi.pl are executed also for mule.pl:

spawned uWSGI master process (pid: 10371)
spawned uWSGI worker 1 (pid: 10372, cores: 1)
spawned uWSGI mule 1 (pid: 10373)
[10372]: postfork(1)
[10373]: postfork(0)
10373: Mule loaded
...
^CSIGINT/SIGQUIT received...killing workers...
Signal SIGINT received, but no signal handler set.
[10373]: atexit(0)
[10372]: atexit(1)

uwsgi::postfork()/atexit() are called only in psgi.pl, but both are executed also in mule.pl (value in parens is worker_id)

Is this "behavior by design" or it should not be like this (I use uwsgi 2.0.13.1 on CentOS 7)?

I would expect that mule.pl (and any mule which is explicitly named) would be forked/started independently from workers.

Besides, when starting a (perl) mule, Devel::StackTrace is referenced but not use(ed), thus preventing stack trace generation on exceptions:

[10456]: postfork(1)
[10457]: postfork(0)
10457: Mule loaded
Can't locate object method "new" via package "Devel::StackTrace" (perhaps you forgot to load "Devel::StackTrace"?) at (eval 14) line 1.
[10457]: atexit(0)

this happens when mule.pl dies on any error - 1/0 in this case - which is invisible unless I "use Devel::StackTrace" in mule.pl

Thank you for listening :)

--
Best regards,
Alexander.

_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to