Thanks for the Path, Phil. Unfortunately I can't apply it. While it allows your test case to pass, it also breaks other tests. Which documentation is it meant to address?

t/30_loops/10_select/k_sig_child........ok 4/15Please mail the following information to [EMAIL PROTECTED]: retrieving parent of a nonexistent session at /Users/troc/projects/ poe/poe/lib/POE/Resource/Sessions.pm line 263
[...]
t/30_loops/10_select/k_signals..........ok 3/8Please mail the following information to [EMAIL PROTECTED]: retrieving parent of a nonexistent session at /Users/troc/projects/ poe/poe/lib/POE/Resource/Sessions.pm line 263
[...]
t/90_regression/rt23181-sigchld-rc...........ok 1/1Please mail the following information to [EMAIL PROTECTED]: retrieving parent of a nonexistent session at /Users/troc/projects/ poe/poe/lib/POE/Resource/Sessions.pm line 263
[...]

--
Rocco Caputo - [EMAIL PROTECTED]


On Jul 17, 2007, at 20:28, Phil Whelan wrote:

Hi,

Where should I send my patch to POE::Kernel? The propagation of
exceptions did not seem to be working as documented.

Thanks,
Phil

--- /usr/local/share/perl/5.8.8/POE/Kernel.pm   2007-07-17
16:54:57.000000000 -0700
+++ /usr/local/share/perl/5.8.8/POE/Kernel.pm   2007-07-17
16:56:42.000000000 -0700
@@ -901,7 +901,9 @@
      my $touched_index = 0;
      while ($touched_index < @touched_sessions) {
        my $next_target = $touched_sessions[$touched_index];
- push @touched_sessions, $self->_data_ses_get_children ($next_target);
+        push @touched_sessions,
+            grep { ref($_) ne 'POE::Kernel' }
+            $self->_data_ses_get_parent($next_target);
        $touched_index++;
      }


Test
-----

#!/usr/bin/perl

use strict;
use warnings;

use Test::More tests => 2;
use POE;

POE::Session->create(
   inline_states => {
       _start => sub {
           $poe_kernel->sig(DIE => 'parent_exception');
           POE::Session->create(
               inline_states => {
                   _start => sub {
                       $poe_kernel->sig(DIE => 'child_exception');
$poe_kernel->post($_[SESSION], "throw_exception");
                   },
throw_exception => sub { die "goodbye sweet world" }, child_exception => sub { pass("child got exception") },
               },
           )
       },
       parent_exception => sub {
           pass("parent got exception");
           $poe_kernel->sig_handled();
       },
       _stop => sub { exit },
   },
);

POE::Kernel->run();
exit;


Reply via email to