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
This commit is contained in:
jbjohnso 2012-03-20 18:37:57 +00:00
parent 2c89d9d93a
commit 97f09d34d4

View File

@ -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;
}
}
}
}