From 3d50a375028d7912fbb3ab5b884691b92010a178 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sun, 25 May 2008 01:27:26 +0000 Subject: [PATCH] -Prevent successive nextdestiny requests from spawning busy loop (loss of TCP socket caused parent to exit, child removes FD, but select won't return zero just because of that) -Prevent closed client socket from inducing infinite select due to previous change. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1489 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/sbin/xcatd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-server-2.0/sbin/xcatd b/xCAT-server-2.0/sbin/xcatd index 0ba1c397e..4aa7f9d30 100755 --- a/xCAT-server-2.0/sbin/xcatd +++ b/xCAT-server-2.0/sbin/xcatd @@ -739,7 +739,7 @@ sub plugin_command { if ($sock) { my $clientpresence = new IO::Select; #The client may have gone away without confirmation, don't PIPE over this trivial thing $clientpresence->add($sock); - if ($clientpresence->can_write) { + if ($clientpresence->can_write(5)) { print $sock XMLout(\%done,RootName => 'xcatresponse',NoAttr=>1); } } @@ -783,6 +783,7 @@ sub dispatch_callback { last; } else { $parselect->remove($dispatch_parentfd); #Block until parent acks data + last; } $selbits = $parselect->bits; yield; @@ -1010,6 +1011,7 @@ sub convey_response { last; } else { $parsel->remove($parent_fd); + last; } } yield; #If still around, it means a peer process still hasn't gotten to us, so might as well yield @@ -1107,7 +1109,7 @@ sub service_connection { syslog("local4|err","xcatd: possible BUG encountered by xCAT TCP service: ".$@); } } - $SIG{ALRM}= sub { die "Failure shutting down" }; + $SIG{ALRM}= sub { die "$$ failed shutting down" }; alarm(10); foreach (keys %tables) { $tables{$_}->commit;