From 20775a437705cec3c4a6687e655f88d4e61dbd0b Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 3 Apr 2009 14:40:21 +0000 Subject: [PATCH] -Have blade and ipmi plugins only decrease known child count when the child exiting belongs to it explicitly -Have blade and ipmi plugin children wait longer for parent acknowledgement -Ignore failure to deliver acknowledgements to children that give up and exit before that can occur git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3075 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/blade.pm | 6 +++--- xCAT-server/lib/xcat/plugins/ipmi.pm | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index f424265db..52cc45b77 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -264,7 +264,7 @@ sub waitforack { my $select = new IO::Select; $select->add($sock); my $str; - if ($select->can_read(10)) { # Continue after 10 seconds, even if not acked... + if ($select->can_read(60)) { # Continue after 60 seconds, even if not acked... if ($str = <$sock>) { } else { $select->remove($sock); #Block until parent acks data @@ -2178,7 +2178,7 @@ sub process_request { my $children = 0; - $SIG{CHLD} = sub { my $cpid; while ($cpid = waitpid(-1, WNOHANG) > 0) { delete $mm_comm_pids{$cpid}; $children--; } }; + $SIG{CHLD} = sub { my $cpid; while ($cpid = waitpid(-1, WNOHANG) > 0) { if ($mm_comm_pids{$cpid}) { delete $mm_comm_pids{$cpid}; $children--; } } }; my $inputs = new IO::Select;; foreach my $info (@$moreinfo) { $info=~/^\[(.*)\]\[(.*)\]\[(.*)\]/; @@ -2688,7 +2688,7 @@ sub forward_data { while ($data !~ /ENDOFFREEZE6sK4ci/) { $data .= <$rfh>; } - print $rfh "ACK\n"; + eval { print $rfh "ACK\n"; }; #Ignore ack loss due to child giving up and exiting, we don't actually explicitly care about the acks my $responses=thaw($data); foreach (@$responses) { $callback->($_); diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index d991b1a52..94113b006 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -361,7 +361,7 @@ sub waitforack { my $select = new IO::Select; $select->add($sock); my $str; - if ($select->can_read(10)) { # Continue after 10 seconds, even if not acked... + if ($select->can_read(60)) { # Continue after 60 seconds, even if not acked... if ($str = <$sock>) { } else { $select->remove($sock); #Block until parent acks data @@ -6200,7 +6200,7 @@ sub process_request { } my $children = 0; - $SIG{CHLD} = sub {my $kpid; do { $kpid = waitpid(-1, WNOHANG); if ($kpid > 0) { delete $bmc_comm_pids{$kpid}; $children--; } } while $kpid > 0; }; + $SIG{CHLD} = sub {my $kpid; do { $kpid = waitpid(-1, WNOHANG); if ($bmc_comm_pids{$kpid}) { delete $bmc_comm_pids{$kpid}; $children--; } } while $kpid > 0; }; my $sub_fds = new IO::Select; foreach (@donargs) { while ($children > $ipmimaxp) { @@ -6291,7 +6291,7 @@ sub forward_data { #unserialize data from pipe, chunk at a time, use magic to de while ($data !~ /ENDOFFREEZE6sK4ci/) { $data .= <$rfh>; } - print $rfh "ACK\n"; + eval { print $rfh "ACK\n"; }; # Ignore ack loss to child that has given up and exited my $responses=thaw($data); foreach (@$responses) { #save the nodes that has errors and the ones that has no-op for use by the node status monitoring