We're also currently looking at catching exceptions using the DIE
signal, but have found the behavior of POE different to what would
expect. The signal is not propagated to the parent sessions, but is
sent to all the children. If sig_handled is set then it is still
propagated to the remaining sessions, but the Kernel does not abort.
What makes more sense to us is if the signal is propagated to the
closet parent session with a signal handler, which handles the signal
and then fires it's own DIE signal if it wishes to propagate the
signal further to their parents.
Has anyone else found this problem, or are we missing something in the docs?

Sorry Kenny, I know this is only loosely related to your question and
certainly does not answer it.

Cheers,
Phil

On 18/07/07, Kenneth Flegal <[EMAIL PROTECTED]> wrote:
My question is not HOW to catch these signals I have multiple places
where I do this it's WHERE to catch these signals when they come from a
session that has detached itself. Every component that I have gotten
from CPAN detaches itself this way and since my sessions are not the
parent I don't see a way to catch them because the signals propagate up
through the parents. If I am not missing something simple this means
that anything that detaches and then dies has the ability to kill my
entire program which is not acceptable.



- Kenny



________________________________

From: David Davis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 18, 2007 2:43 PM
To: Kenneth Flegal
Cc: poe@perl.org
Subject: Re: Catching DIE signal from detached sessions



Hi Kenneth,

Please see the docs on this subject at:

http://search.cpan.org/~rcaputo/POE-0.9989/lib/POE/Kernel.pm#Signal_Watc
her_Methods
and
http://search.cpan.org/~rcaputo/POE-0.9989/lib/POE/Session.pm#Exceptions

HTH,
David

On 7/18/07, Kenneth Flegal <[EMAIL PROTECTED]> wrote:

I am really hoping that I am just missing something simple with this one
but at the moment I am a bit stumped. I am currently working with
multiple components which are provided with an alias and then detach
from the calling session. This seems to be common practice with the
components available on CPAN. The program that I am writing runs as a
daemon so it is imperative that the program continue and should never
need to die completely due to a problem within one of these aliased
sessions. However in the case that one of these dies I do not have any
sessions that are considered the parent session so the DIE signal goes
uncaught and kills the whole program.



Ideally at this point I would like to create an event to catch any
errors that make it passed any given session regardless of it's parent
to ensure that the program handles an unhandled exception anywhere in
the program. I have been looking through the docs though and don't see
anything that would allow for me to do this since all handlers appear to
be for the session that $kernel->sig() is called in. I also tried
overriding $SIG{'__DIE__'} before doing anything else but this doesn't
seem to be doing the trick either. I would also like to be able to have
all of the information that the kernel exception handler provides when
it catches something which the $SIG{__DIE__} solution wouldn't provide.
Is there a way to do what I am looking for here? I would greatly
appreciate any advice that might point me in the right direction.



- Kenny







--

David Davis
Software Engineer

Reply via email to