Bug 122391 - Polling pipes fails on Fedora. Example provided
Polling pipes fails on Fedora. Example provided
Status: CLOSED INSUFFICIENT_DATA
Product: Fedora
Classification: Fedora
Component: perl-DBI (Show other bugs)
3
All Linux
medium Severity high
: ---
: ---
Assigned To: Warren Togami
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-05-03 18:46 EDT by Ray Gwinn
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-17 13:24:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ray Gwinn 2004-05-03 18:46:46 EDT
Polling pipes does not seem to work correctly on Fedora 1.  Two perl
scripts follow that demonstrate the problem.

The below scripts work on all distros that I have tested, including 
RH9, but fails on Fedora 1.  I have not tried the test Fedora 2.

Ray

#!/usr/local/bin/perl -w
# This script is called "test.pl" and is run in the pipe.

use strict;
$| = 1;

print "out1\n";
sleep 3;
print "out2\n";
sleep 3;
print "out3\n";
sleep 3;
print "out4\n";
exit;

Following is a script that invokes the above script.

#!/usr/local/bin/perl -w
# This script polls a command pipe by checking the filesize
# of the pipe's file handle.
use Tk;
use strict;

my $MW = MainWindow->new;
my $txt = $MW->Text->pack;

open (MY_PIPE, "test.pl |") or die "Couldn't open: $!\n";
my $pipe = \*MY_PIPE;

$MW->repeat(50 => \&read_pipe);

MainLoop;

sub read_pipe {
   # Read from the pipe if data is present there.
   my $size = -s $pipe;
   if ($size) {
      my $line;
      sysread($pipe,$line,$size);
      return unless $line;
      $txt->insert('end', "$line");
      $MW->update;
   }
}
Comment 1 Ray Gwinn 2004-05-11 12:01:40 EDT
I have now tested the pipe polling problem on Fedora 2, test 3.  The 
problem still exists.

Ray
Comment 2 Warren Togami 2005-09-08 23:13:35 EDT
What about FC4?

Note You need to log in before you can comment on or make changes to this bug.