From 7f125d8e2e56f336272781f0078b8c323b894acc Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 7 Jun 2011 17:00:59 +0000 Subject: [PATCH] Provide small performance boost to every exchange with DB worker process git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9756 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Table.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 07c5cf84d..a24bfa867 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -108,11 +108,12 @@ sub dbc_submit { print $clisock $data; $data=""; my $lastline=""; - while ($lastline ne "ENDOFFREEZEQFVyo4Cj6Q0j\n" and $lastline ne "*XCATBUGDETECTED*76e9b54341\n") { #index($lastline,"ENDOFFREEZEQFVyo4Cj6Q0j") < 0) { - $lastline = <$clisock>; + while (read($clisock,$lastline,32768)) { #$lastline ne "ENDOFFREEZEQFVyo4Cj6Q0j\n" and $lastline ne "*XCATBUGDETECTED*76e9b54341\n") { #index($lastline,"ENDOFFREEZEQFVyo4Cj6Q0j") < 0) { +# $lastline = <$clisock>; $data .= $lastline; } - if ($lastline eq "*XCATBUGDETECTED*76e9b54341\n") { #if it was an error + close($clisock); + if ($lastline =~ m/*XCATBUGDETECTED*76e9b54341\n\z/) { #if it was an error #in the midst of the operation, die like it used to die my $err; $data =~ /\*XCATBUGDETECTED\*:(.*):\*XCATBUGDETECTED\*/s; @@ -241,8 +242,10 @@ sub handle_dbc_conn { @returndata = (scalar(handle_dbc_request($request))); } $response = freeze(\@returndata); - $response .= "\nENDOFFREEZEQFVyo4Cj6Q0j\n"; + # $response .= "\nENDOFFREEZEQFVyo4Cj6Q0j\n"; print $client $response; + $clientset->remove($client); + close($client); } else { #Connection terminated, clean up $clientset->remove($client); close($client);