Forum OpenACS Q&A: Response to ns_atexit / ns_atshutdown failing silently

Collapse
Posted by Jonathan Ellis on
I ripped out jerry's vhr patches, and still no love from the shutdown procedures.  I didn't think that would be the problem, since both test and production servers were running those same patches, but I tried it anyway.

Note that it's not just "my" ns_atshutdown that doesn't work; under the hood, ns_atshutdown calls Ns_AtShutdown (surprise :0) which is the same way nssock schedules it's cleanup proc that logs the "nssock: shutdown complete" message.

The only difference between test server and production is that production is under heavy load.  So I fired up my test server again, jammed ab -100000 down its throat, and hit it with a SIGTERM.

It didn't run the atshutdown procs.  I tried it twice more both ways to be sure and it's consistent: under load, no ns_atshutdown.  No load, ns_atshutdown runs fine.

I'm disappointed how the more I push the limits of nsd the less robust it appears.  I could roll my own "shutdown" script that signals a filter to stop processing requests, runs any scheduled procs, then kill -9s itself, and I guess that's what I'll end up doing.  Anyone have any luck with nsd 3.4? :P