NM, problem solved.
For those that are curious: I erred in stating I was using
PO::Filter::Line to process input; I'm actually using
POE::Wheel:ReadWrite with Filter::Line as an input filter. The issue
was that I had not created an error handler in my ReadWrite object -
once I did, setting the handler to "exit 0", the rewriter now catches
EOF as an error in ReadWrite and dies properly as it should.
-C
On Jan 18, 2008, at 7:46 PM, Chris Woodfield wrote:
Hi all,
I'm working on a custom url_rewriter helper app, written in perl,
that translates incoming URL requests to custom URLs using a config
file that is loaded at startup and is polled for changes at regular
intervals.
In order to handle the update polling, the script uses POE for event
handling, using POE::Filter::Line to handle incoming URL requests
from squid and then a delay to handle the config poll interval.
The problem I've found, which I didn't have when the first iteration
of the script was simply a while(<>) loop, is that when squid exits
or is HUP'ed, it kills the existing helper apps by sending an EOF
(Ctrl-D). However, POE's signal handling doesn't seem to be able to
respond to EOF (only KILL, HUP, etc), and as such, the children
never exit.
Anyone know enough about POE to let me know if I'm missing something
I can do in my code in order to enable POE's handling the EXIT/EOF/
CRTL-D signal? Or a way to make squid use KILL instead of EOF to
kill off the url rewriters for sure?
Thanks,
-Chris