From 37c0e9303b7fe167e33a588748c6448d5e020242 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 25 Apr 2008 21:09:18 +0000 Subject: [PATCH] -Have client detect prematurely ended xCAT sessions (i.e. without serverdone performed) -Fix problem where server would prematurely end xCAT sessions. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1209 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/Client.pm | 5 +++++ xCAT-server-2.0/sbin/xcatd | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/perl-xCAT-2.0/xCAT/Client.pm b/perl-xCAT-2.0/xCAT/Client.pm index f7b5591eb..66f79b07d 100644 --- a/perl-xCAT-2.0/xCAT/Client.pm +++ b/perl-xCAT-2.0/xCAT/Client.pm @@ -142,6 +142,7 @@ sub submit_request { print $client $msg; my $response; my $rsp; + my $cleanexit=0; while (<$client>) { $response .= $_; if ($response =~ m/<\/xcatresponse>/) { @@ -149,10 +150,14 @@ sub submit_request { $response=''; $callback->($rsp); if ($rsp->{serverdone}) { + $cleanexit=1; last; } } } + unless ($cleanexit) { + print STDERR "ERROR/WARNING: communication with the xCAT server seems to have been ended prematurely\n"; + } ################################### # scan_plugins diff --git a/xCAT-server-2.0/sbin/xcatd b/xCAT-server-2.0/sbin/xcatd index 368b32132..9aba18eb6 100755 --- a/xCAT-server-2.0/sbin/xcatd +++ b/xCAT-server-2.0/sbin/xcatd @@ -947,7 +947,7 @@ sub convey_response { my $parsel = new IO::Select; $parsel->add($parent_fd); if ($parsel->can_read(5)) { #block up to five seconds for parent to ack - ; + <$parent_fd>; } #<$parent_fd>; #Block until parent acks data # KeyAttr => [], NoAttr => 1)