Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 72581
Status: resolved
Priority: 0/
Queue: POE

People
Owner: Nobody in particular
Requestors: pce [...] accesswave.ca
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Possible POE bug
Date: Mon, 21 Nov 2011 11:34:06 -0400
To: bug-POE [...] rt.cpan.org
From: Peter Payzant <pce [...] accesswave.ca>
Hi- I'm receiving the following error text from my POE program, with ASSERT-DEFAULT = 1. It's almost certainly a programming error on my part, but on the off-chance that you can spot anything, I'm attaching the source of the affected program. Thanks Peter Payzant === (8114) === Please address any warnings or errors above this message, and try again. If there are none, or those messages are from within POE, then please mail them along with the following information to bug-POE@rt.cpan.org: --- <dt> Cannot resolve ``scanner'' into a session reference ----- at inside_temps_snapshot.pm line 72 inside_temps_snapshot::__ANON__('undef', 'POE::Session=ARRAY(0x878d888)', 'POE::Kernel=ARRAY(0x82a73c4)', 'HASH(0x878d840)', 'got_connect_error', 'POE::Session=ARRAY(0x878d888)', 'undef', '/usr/local/share/perl/5.8.8/POE/Wheel/SocketFactory.pm', 267, ...) called at /usr/local/share/perl/5.8.8/POE/Component/Client/TCP.pm line 234 POE::Component::Client::TCP::__ANON__('undef', 'POE::Session=ARRAY(0x878d888)', 'POE::Kernel=ARRAY(0x82a73c4)', 'HASH(0x878d840)', 'got_connect_error', 'POE::Session=ARRAY(0x878d888)', 'undef', '/usr/local/share/perl/5.8.8/POE/Wheel/SocketFactory.pm', 267, ...) called at /usr/local/share/perl/5.8.8/POE/Session.pm line 464 POE::Session::_invoke_state('POE::Session=ARRAY(0x878d888)', 'POE::Session=ARRAY(0x878d888)', 'got_connect_error', 'ARRAY(0x82e9e84)', '/usr/local/share/perl/5.8.8/POE/Wheel/SocketFactory.pm', 267, 'POE::Wheel::SocketFactory(19) -> select connect') called at /usr/local/share/perl/5.8.8/POE/Kernel.pm line 1715 POE::Kernel::call('POE::Kernel=ARRAY(0x82a73c4)', 'POE::Session=ARRAY(0x878d888)', 'got_connect_error', 'connect', 111, 'Connection refused', 19) called at /usr/local/share/perl/5.8.8/POE/Wheel/SocketFactory.pm line 267 POE::Wheel::SocketFactory::__ANON__('undef', 'POE::Session=ARRAY(0x878d888)', 'POE::Kernel=ARRAY(0x82a73c4)', 'HASH(0x878d840)', 'POE::Wheel::SocketFactory(19) -> select connect', 'POE::Session=ARRAY(0x878d888)', 'undef', '/usr/local/share/perl/5.8.8/POE/Resource/FileHandles.pm', 240, ...) called at /usr/local/share/perl/5.8.8/POE/Session.pm line 464 POE::Session::_invoke_state('POE::Session=ARRAY(0x878d888)', 'POE::Session=ARRAY(0x878d888)', 'POE::Wheel::SocketFactory(19) -> select connect', 'ARRAY(0x878f7a8)', '/usr/local/share/perl/5.8.8/POE/Resource/FileHandles.pm', 240, 'undef') called at /usr/local/share/perl/5.8.8/POE/Kernel.pm line 1040 eval {...} called at /usr/local/share/perl/5.8.8/POE/Kernel.pm line 1039 POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x82a73c4)', 'POE::Session=ARRAY(0x878d888)', 'POE::Session=ARRAY(0x878d888)', 'POE::Wheel::SocketFactory(19) -> select connect', 1024, 'ARRAY(0x878f7a8)', '/usr/local/share/perl/5.8.8/POE/Resource/FileHandles.pm', 240, 'undef', ...) called at /usr/local/share/perl/5.8.8/POE/Resource/FileHandles.pm line 238 POE::Kernel::_data_handle_enqueue_ready('undef', 'undef', 3) called at /usr/local/share/perl/5.8.8/POE/Loop/Select.pm line 286 POE::Kernel::loop_do_timeslice('POE::Kernel=ARRAY(0x82a73c4)') called at /usr/local/share/perl/5.8.8/POE/Loop/Select.pm line 314 POE::Kernel::loop_run('POE::Kernel=ARRAY(0x82a73c4)') called at /usr/local/share/perl/5.8.8/POE/Kernel.pm line 1218 POE::Kernel::run('POE::Kernel') called at ./inside_temps.pl line 35

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #72581] AutoReply: Possible POE bug
Date: Mon, 21 Nov 2011 19:17:32 -0400
To: bug-POE [...] rt.cpan.org
From: Peter Payzant <pce [...] accesswave.ca>
Here's a tiny program which demonstrates the issue. On my system, it fails right away. Peter

Message body is not shown because sender requested not to inline it.

Hi, Peter! The crux of the error is that the "scanner" alias is not active at the time the program calls post(): Show quoted text
> <dt> Cannot resolve ``scanner'' into a session reference
The order of initialization implies that "scanner" should be in effect: create_data_session(); ## starts the "scanner" client create_point_librarian_session(); create_snapshot_session(); ## starts post()ing to "scanner" The error is being thrown from a "ConnectError" callback, which means there's a network problem. It could be that the "scanner" has also thrown an error, in which case its alias may have been removed by the time post() is called. It would help to have a smaller test case that I could run and debug. Seeing the problem first-hand makes all the difference.
Subject: Re: [rt.cpan.org #72581] Possible POE bug
Date: Thu, 15 Dec 2011 16:00:16 -0400
To: bug-POE [...] rt.cpan.org
From: Peter Payzant <pce [...] accesswave.ca>
Sorry about posting such a lot of code initially. I did subsequently post a very short test case. Peter On 2011/12/15 3:11 PM, Rocco Caputo via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=72581> > > Hi, Peter! > > The crux of the error is that the "scanner" alias is not active at the time the program calls > post():
>> <dt> Cannot resolve ``scanner'' into a session reference
> The order of initialization implies that "scanner" should be in effect: > > create_data_session(); ## starts the "scanner" client > create_point_librarian_session(); > create_snapshot_session(); ## starts post()ing to "scanner" > > The error is being thrown from a "ConnectError" callback, which means there's a network > problem. It could be that the "scanner" has also thrown an error, in which case its alias may > have been removed by the time post() is called. > > It would help to have a smaller test case that I could run and debug. Seeing the problem > first-hand makes all the difference. >
On Thu Dec 15 15:00:21 2011, pce@accesswave.ca wrote: Show quoted text
> Sorry about posting such a lot of code initially. I did subsequently > post a very short test case.
Thanks, Peter! I've just run the small test case. It's still a timing issue. POE::Component::Client::TCP's "Started" callback is invoked synchronously before new() returns. Client "one" is created, and post_it() is called right away. Client "two" hasn't been created yet, so the post() fails under ASSERT_DEFAULT. Without the assertions, the program would just silently hang. The solution I've settled on is to swap the POE::Component::Client::TCP->new() calls. Creating "two" before "one" lets post_it() succeed. If this doesn't satisfactorily solve the original problem, please let me know the additional details I haven't addressed.
I wrote "If this doesn't satisfactorily solve the original problem, please let me know the additional details I haven't addressed." No response implies it's okay. Tentatively resolving this ticket. Please reopen if needed.