Changing pinging to FXSs. Manual reconnection in case connection gets lost.
authorzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 Aug 2009 08:28:19 +0000 (08:28 +0000)
committerzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 Aug 2009 08:28:19 +0000 (08:28 +0000)
SHUTTLE/AliShuttle.cxx

index 45b6600..a750824 100644 (file)
@@ -2535,11 +2535,19 @@ Bool_t AliShuttle::Connect(Int_t system)
        //
 
        // check connection: if already connected return
+
        if(fServer[system] && fServer[system]->IsConnected()) {
-               // ping the server --> automatic reconnection should occur if it was broken but the
-               // server is still alive
-               fServer[system]->Ping();
-               return kTRUE;
+               // ping the server              
+               if (fServer[system]->PingVerify()==kTRUE){ // connection is still alive
+                       return kTRUE;
+               }               
+               else{
+                       AliWarning(Form("Connection got lost to FXS database for %s. Closing and reconnecting.",
+                                       AliShuttleInterface::GetSystemName(system)));
+                       fServer[system]->Close();
+                       delete fServer[system];
+                       fServer[system] = 0x0;
+               }
        }
 
        TString dbHost, dbUser, dbPass, dbName;