Skip Menu |

This queue is for tickets about the POE CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: DBOOK [...] cpan.org
Cc:
AdminCc:

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



Subject: No-sessions check in POE::Kernel::run is ineffective
POE::Kernel creates a session when initialized, which means its session count will always be at least 1 when checked in run() ($self->_data_ses_count() == 0) which causes it to run the loop. With POE::Loop::EV the automatic signal handler is handled by EV so the loop waits indefinitely. Don't know if that should be changed to check <= 1 or if another method should be used to check (external) session count.
FYI the issue with POE::Loop::EV running the loop indefinitely turned out to be something else, but it is still apparent this check is ineffective (this code is never reached).
On Thu Jan 01 02:33:18 2015, DBOOK wrote: Show quoted text
> POE::Kernel creates a session when initialized, which means its > session count will always be at least 1 when checked in run() ($self-
> >_data_ses_count() == 0) which causes it to run the loop. With
> POE::Loop::EV the automatic signal handler is handled by EV so the > loop waits indefinitely. Don't know if that should be changed to check > <= 1 or if another method should be used to check (external) session > count.
There should probably be a flag on internal sessions that allow them not to count. I think the same sort of thing for events might be an improvement over _idle_queue_grow() and its related functions. I think the assertion in question is useful. It prevented "POE" from crashing in an identified edge case, and it told developers they had tried a silly thing. While it's currently impossible for the assertion to trigger, changes at a distance and by uncoordinated developers could make it relevant again. Runtime overhead is negligible, and it has reduced (and may again reduce) development overhead. I've commented the code to refer back to this ticket, but I have no intent to remove the check at this time.