httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestServer.pm
Date Wed, 21 May 2003 04:02:15 GMT
stas        2003/05/20 21:02:14

  Modified:    perl-framework/Apache-Test/lib/Apache TestServer.pm
  Log:
  try to avoid the race condition when the pid file was created but not yet
  written to (by sleeping for fractions of a second)
  
  Revision  Changes    Path
  1.62      +8 -0      httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm
  
  Index: TestServer.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- TestServer.pm	21 Jan 2003 05:54:51 -0000	1.61
  +++ TestServer.pm	21 May 2003 04:02:14 -0000	1.62
  @@ -252,6 +252,14 @@
       open $fh, $file or do {
           return 0;
       };
  +
  +    # try to avoid the race condition when the pid file was created
  +    # but not yet written to
  +    for (1..8) {
  +        last if -s $file > 0;
  +        select undef, undef, undef, 0.25;
  +    }
  +
       chomp(my $pid = <$fh>);
       $pid;
   }
  
  
  

Mime
View raw message