From 97f09d34d41d4a9e3e51086871f8f2b937d72b4f Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 20 Mar 2012 18:37:57 +0000 Subject: [PATCH] Have xCATd more robustly give client 5 seconds to receive message git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@11914 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index c9ccdb37f..23c05a148 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -1269,9 +1269,13 @@ 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(5)) { - print $sock XMLout(\%done,RootName => 'xcatresponse',NoAttr=>1); - } + my $deadline = time()+5; + while ($deadline > time()) { #sometimes can_write exits prematurely without waiting the whole time..... + if ($clientpresence->can_write(5)) { + print $sock XMLout(\%done,RootName => 'xcatresponse',NoAttr=>1); + last; + } + } } }