[OpenSRF-GIT] OpenSRF branch master updated. 8cfa0ae50935176a1574e8f233c8d4d88442c0ad

Evergreen Git git at git.evergreen-ils.org
Wed Mar 7 15:25:11 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSRF".

The branch, master has been updated
       via  8cfa0ae50935176a1574e8f233c8d4d88442c0ad (commit)
      from  37606bf64f2829258cc612e730782e081e2ac6bb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8cfa0ae50935176a1574e8f233c8d4d88442c0ad
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Feb 16 17:31:29 2012 -0500

    Refresh child file handles on status read
    
    If a child process dies while the parent is attempting to read status
    information from the child, the pipe connecting the two will be cleaned
    up.  The parent mustn't attempt to read from the dead pipe or it will
    result in a bad file descriptor error, culminating in a high-cpu
    infinite loop on the parent (Listener) process.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/src/perl/lib/OpenSRF/Server.pm b/src/perl/lib/OpenSRF/Server.pm
index 6cab1dd..8034a1a 100644
--- a/src/perl/lib/OpenSRF/Server.pm
+++ b/src/perl/lib/OpenSRF/Server.pm
@@ -270,9 +270,6 @@ sub check_status {
 
     return unless @{$self->{active_list}};
 
-    my $read_set = IO::Select->new;
-    $read_set->add($_->{pipe_to_child}) for @{$self->{active_list}};
-
     my @pids;
 
     while (1) {
@@ -280,6 +277,10 @@ sub check_status {
         # if can_read or sysread is interrupted while bloking, go back and 
         # wait again until we have at least 1 free child
 
+        # refresh the read_set handles in case we lost a child in the previous iteration
+        my $read_set = IO::Select->new;
+        $read_set->add($_->{pipe_to_child}) for @{$self->{active_list}};
+
         if(my @handles = $read_set->can_read(($block) ? undef : 0)) {
             my $pid = '';
             for my $pipe (@handles) {

-----------------------------------------------------------------------

Summary of changes:
 src/perl/lib/OpenSRF/Server.pm |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
OpenSRF


More information about the opensrf-commits mailing list