From 85a3468e0f7d7d3c93328e8a76ca577e9b5c7946 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 16 Mar 2012 18:41:47 +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/trunk@11883 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; + } + } } }