Re: POE::Kernel->stop() will trigger _stop in the next release

[email protected] (Deven Parekh) Wed, 11 Nov 2015 18:31:35 -0600
Newsgroups perl.poe
Message-ID <CAD-35iK=t_cENFB+z-A5N2h9ZPz3FNDoSm7LswMY6sq9vAZjJg@mail.gmail.com>
--e89a8ff1ce78bdb70905244d1048
Content-Type: text/plain; charset=UTF-8

Hello,

Thank you for the quick response.

I will try to generate a test case for the above.

In the mean time if this helps, I did a hand edit to  the stop subroutine
in POE::Kernel and replaced

$self->_data_ses_stop($session->ID);

(which appears in the latest version )

with

$self->_data_ses_free($session->ID);

(which was how it was in previous version)

and the program is working as expected now.


I will try to generate a test case and send it for debugging.

Thanks in advance,

Best Regards.

On Tue, Nov 10, 2015 at 2:53 PM, Rocco Caputo <[email protected]> wrote:

> I don't expect the change to cause the behavior you've reported.
>
> If you can reduce your program to a self-contained test case, something I
> can run myself using only easily installed, public dependencies, I can
> investigate what happened.
>
> --
> Rocco Caputo <[email protected]>
>
> On Nov 10, 2015, at 15:12, Deven Parekh <[email protected]> wrote:
>
> Hello,
>
> Is it possible that it breaks the following capability of POE::Wheel::Run
> Running POE::Kernel in the Child
>
> Calling POE::Kernel->run() in the child process effectively resumes the
> copy of the parent process. This is rarely (if ever) desired.
>
> More commonly, an application wants to run an entirely new POE::Kernel
> instance in the child process. This is supported by first stop()ping the
> copied instance, starting one or more new sessions, and calling run()
> again. For example:
>
>   Program => sub {
>     # Wipe the existing POE::Kernel clean.
>     $poe_kernel->stop();
>
>     # Start a new session, or more.
>     POE::Session->create(
>       ...
>     );
>
>     # Run the new sessions.
>     POE::Kernel->run();
>   }
>
> I had a program that used the above construct which works fine with
>
> POE  => $VERSION = '1.354';
>
> POE::Wheel::Run => $VERSION = '1.354';
>
>
> However with
>
> POE => $VERSION = '1.367';
> POE::Wheel::Run => $VERSION = '1.367';
>
> It seems calling POE::Kernel->stop(); it stops the POE::Kernel instance in parent as well.
>
> Just wondering if the above change could be causing this behaviour (?)
>
> Thanks in advance.
>
> Best Regards
>
>
>
>
> On Thu, Oct 30, 2014 at 4:00 PM, Rocco Caputo <[email protected]> wrote:
>
>> Hello, everyone.  I hope you've been well.
>>
>> It's come to my attention that POE::Kernel->stop() isn't triggering _stop
>> handlers.  This seems wrong, so I've changed it.  I hope it doesn't break
>> anything, but I'm mentioning it here in case people want to check in
>> advance of a release.
>>
>> I've already run it past irc.perl.org #poe, and nobody objected.
>>
>> --
>> Rocco Caputo <[email protected]>
>
>
>
>

--e89a8ff1ce78bdb70905244d1048
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div><div><div><div><div><div>Hello,<br><br>Than=
k you for the quick response.<br><br></div>I will try to generate a test ca=
se for the above.<br><br></div>In the mean time if this helps, I did a hand=
 edit to=C2=A0 the stop subroutine in POE::Kernel and replaced <br><br>$sel=
f-&gt;_data_ses_stop($session-&gt;ID);<br><br></div><div>(which appears in =
the latest version )<br></div><div><br></div><div>with <br><br>$self-&gt;_d=
ata_ses_free($session-&gt;ID);<br></div><div><br></div>(which was how it wa=
s in previous version)<br><br></div>and the program is working as expected =
now.<br><br></div><div><br></div>I will try to generate a test case and sen=
d it for debugging.<br><br></div>Thanks in advance,<br><br></div>Best Regar=
ds.<br></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote=
">On Tue, Nov 10, 2015 at 2:53 PM, Rocco Caputo <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;=
</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:br=
eak-word"><div>I don&#39;t expect the change to cause the behavior you&#39;=
ve reported.</div><div><br></div><div>If you can reduce your program to a s=
elf-contained test case, something I can run myself using only easily insta=
lled, public dependencies, I can investigate what happened.</div><div><span=
 class=3D"HOEnZb"><font color=3D"#888888"><br><div>
<span style=3D"border-collapse:separate;color:rgb(0,0,0);font-family:Monaco=
;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:no=
rmal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none=
;white-space:normal;word-spacing:0px"><div>--=C2=A0</div><div>Rocco Caputo =
&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
m</a>&gt;</div></span>

</div></font></span><div><div class=3D"h5">
<br><div><blockquote type=3D"cite"><div>On Nov 10, 2015, at 15:12, Deven Pa=
rekh &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">parekh=
[email protected]</a>&gt; wrote:</div><br><div><div dir=3D"ltr"><div>Hello,<=
br><br></div>Is it possible that it breaks the following capability of POE:=
:Wheel::Run<br><h3><a name=3D"150f32d7e04f3724_Running_POE::Kernel_in_the_C=
hild">Running POE::Kernel in the Child</a></h3><p>Calling <code>POE::Kernel=
-&gt;run()</code> in the child process effectively resumes the copy of the =
parent process. This is rarely (if ever) desired.</p><p>More commonly, an a=
pplication wants to run an entirely new=20
POE::Kernel instance in the child process. This is supported by first=20
stop()ping the copied instance, starting one or more new sessions, and=20
calling run() again. For example:</p>

<pre>  Program <span>=3D&gt;</span> <span>sub</span> <span>{</span>
    <span># Wipe the existing POE::Kernel clean.</span>
    <span>$poe_kernel</span><span>-&gt;</span><span>stop</span><span>();</s=
pan>

    <span># Start a new session, or more.</span>
    POE<span>::</span>Session<span>-&gt;</span><span>create</span><span>(</=
span>
      <span>...</span>
    <span>);</span>

    <span># Run the new sessions.</span>
    POE<span>::</span>Kernel<span>-&gt;</span><span>run</span><span>();</sp=
an>
  <span>}<br><br></span></pre><pre><span>I had a program that used the abov=
e construct which works fine with<br></span></pre><pre><span>POE  =3D&gt; $=
VERSION =3D &#39;1.354&#39;;<br></span></pre><pre><span>POE::Wheel::Run =3D=
&gt; $VERSION =3D &#39;1.354&#39;;<br><br><br></span></pre><pre><span>Howev=
er with <br></span></pre><pre><span>POE =3D&gt; </span><span>$VERSION =3D &=
#39;1.367&#39;;<br></span><span>POE::Wheel::Run =3D&gt; $VERSION =3D &#39;1=
.367&#39;;<br><br></span></pre><pre><span>It seems calling POE::Kernel-&gt;=
stop(); it stops the POE::Kernel instance in parent as well.<br><br></span>=
</pre><pre><span>Just wondering if the above change could be causing this b=
ehaviour (?)<br><br></span></pre><pre><span>Thanks in advance.<br></span></=
pre><pre><span>Best Regards<br></span></pre><pre><span><br></span></pre><br=
></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Thu, Oc=
t 30, 2014 at 4:00 PM, Rocco Caputo <span dir=3D"ltr">&lt;<a href=3D"mailto=
:[email protected]" target=3D"_blank">[email protected]</a>&gt;</span> wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex">Hello, everyone.=C2=A0 I hope you&#39;=
ve been well.<br>
<br>
It&#39;s come to my attention that POE::Kernel-&gt;stop() isn&#39;t trigger=
ing _stop handlers.=C2=A0 This seems wrong, so I&#39;ve changed it.=C2=A0 I=
 hope it doesn&#39;t break anything, but I&#39;m mentioning it here in case=
 people want to check in advance of a release.<br>
<br>
I&#39;ve already run it past <a href=3D"http://irc.perl.org/" rel=3D"norefe=
rrer" target=3D"_blank">irc.perl.org</a> #poe, and nobody objected.<br>
<span><font color=3D"#888888"><br>
--<br>
Rocco Caputo &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">rca=
[email protected]</a>&gt;</font></span></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></div></blockquote></div><br=
></div>

--e89a8ff1ce78bdb70905244d1048--