Skip Menu |

This queue is for tickets about the POE CPAN distribution.

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

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

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



Subject: POE::Wheel::FollowTail fail
Generic code sample from POE::Wheel::FollowTail (from module synopsis) doesn't work properly with quickly growing log file (about 100 lines per second). InputEvent handler gets only a few lines from log. I tried to debug it and found this strange lines in 'svn di -r 2754:2757 poe/lib/POE/Wheel/FollowTail.pm': - foreach my $cooked_input (@{$filter->get($raw_input)}) { + $filter->get_one_start($raw_input); + foreach my $cooked_input (@{$filter->get_one()}) { I try to revert this and tailing seems fixed.
"Bazerka" reported this in irc.perl.org #poe with a test case. I modified the test case to be self-contained (writes its own log), and am attaching it here. I'll verify your patch with the test case and release a new POE distribution this weekend. Thanks for the patch, and thanks Bazerka for the test case. :)
Subject: bazerka-file-tail.pl
#! /usr/bin/env perl use strict; use warnings; use IO::Handle; use POE qw(Wheel::FollowTail); my $tailfile = "/tmp/xferlog"; my $write; POE::Session->create( inline_states => { _start => sub { open $write, ">", $tailfile or die $!; $write->autoflush(1); $_[KERNEL]->yield("on_tick"); }, on_tick => sub { print "write\n"; print $write "tick at ", scalar(localtime), "\n"; $_[KERNEL]->delay("on_tick" => 1); }, } ); POE::Session->create( inline_states => { _start => sub { print "_start\n"; $_[HEAP]{tailor} = POE::Wheel::FollowTail->new( Filename => $tailfile, InputEvent => "got_log_line", ResetEvent => "got_log_rollover", PollInterval => 10, ); }, got_log_line => sub { print "got_log_line\n"; print scalar localtime(), " got_log_line: $_[ARG0]\n"; }, got_log_rollover => sub { print "got_log_rollover\n"; print "Log rolled over.\n"; }, } ); POE::Kernel->run();
Test case added to POE::Test::Loops. Will be part of POE::Test::Loops 1.032 this weekend.
Thank you for the patch. The underlying problem turned out to be different. I've committed a fix for Bazerka's test case as revision 2798. I'll release a new POE distribution sometime this weekend.