]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - SHUTTLE/AliShuttle.cxx
Corrected two bugs found by Sergey regarding the error calculation.
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttle.cxx
index 2012cf9e651779b080d9df0da6936e3ddb976a19..5ba088f3f5771ff6752e54f29378d043222f25ec 100644 (file)
@@ -256,7 +256,7 @@ Bool_t AliShuttle::StoreOCDB()
        //
        
        UpdateShuttleStatus(AliShuttleStatus::kStoreStarted);
-                               
+                       
        if (fTestMode & kErrorGrid)
        {
                Log("SHUTTLE", "StoreOCDB - In TESTMODE - Simulating error while storing in the Grid");
@@ -1385,16 +1385,42 @@ Bool_t AliShuttle::Process(AliShuttleLogbookEntry* entry)
 
                                if (expiredTime > fConfig->GetPPTimeOut())
                                {
-                                       TString tmp;
-                                       tmp.Form("Process - Process of %s time out. "
-                                                       "Run time: %d seconds. Killing...",
-                                                       fCurrentDetector.Data(), expiredTime);
-                                       Log("SHUTTLE", tmp);
-                                       Log(fCurrentDetector, tmp);
+                                        TString logMsg;
+                                       AliShuttleStatus *currentStatus = ReadShuttleStatus();
+                                       AliShuttleStatus::Status newStatus = AliShuttleStatus::kInvalid;
+                                       
+                                       if (currentStatus->GetStatus() <= AliShuttleStatus::kPPDone)
+                                       {
+                                               // in case pp not yet done set status to kPPTimeOut
+                                       
+                                               logMsg.Form("Process - Process of %s timed out. Run time: %d seconds. Killing...",
+                                                               fCurrentDetector.Data(), expiredTime);
+                                               newStatus = AliShuttleStatus::kPPTimeOut;
+                                       }
+                                       else if (currentStatus->GetStatus() == AliShuttleStatus::kStoreStarted)
+                                       {
+                                               // in case the pp goes in TimeOut while storing the objects in the OCDB
+                                               // set status to kStoreError
+                                               
+                                               logMsg.Form("Process - Process of %s timed out while storing the OCDB object. Run time: %d seconds. Killing... and setting status to StoreError.",
+                                                               fCurrentDetector.Data(), expiredTime);
+                                               newStatus = AliShuttleStatus::kStoreError;
+                                       }
+                                       else 
+                                       {
+                                               // in other cases don't change the status
+                                               
+                                               logMsg.Form("Process - Process of %s timed out in status = %s. Run time: %d seconds. Killing... without changing the status",
+                                                               fCurrentDetector.Data(), currentStatus->GetStatusName(), expiredTime);
+                                       }
+                               
+                                       Log("SHUTTLE", logMsg);
+                                       Log(fCurrentDetector, logMsg);
 
                                        kill(pid, 9);
 
-                                       UpdateShuttleStatus(AliShuttleStatus::kPPTimeOut);
+                                       if (newStatus != AliShuttleStatus::kInvalid)
+                                               UpdateShuttleStatus(newStatus);
                                        hasError = kTRUE;
 
                                        gSystem->Sleep(1000);
@@ -1662,6 +1688,7 @@ Int_t AliShuttle::ProcessCurrentDetector()
 
                        if (fConfig->GetDCSAliases(fCurrentDetector, iServ)->GetEntries() > 0)
                        {
+                               Log(fCurrentDetector, Form("Querying %d DCS aliases", fConfig->GetDCSAliases(fCurrentDetector, iServ)->GetEntries()));
                                aliasMap = GetValueSet(host, port, 
                                                fConfig->GetDCSAliases(fCurrentDetector, iServ), 
                                                kAlias, multiSplit);
@@ -1684,6 +1711,7 @@ Int_t AliShuttle::ProcessCurrentDetector()
                        
                        if (fConfig->GetDCSDataPoints(fCurrentDetector, iServ)->GetEntries() > 0)
                        {
+                               Log(fCurrentDetector, Form("Querying %d DCS data points", fConfig->GetDCSDataPoints(fCurrentDetector, iServ)->GetEntries()));
                                dpMap = GetValueSet(host, port, 
                                                fConfig->GetDCSDataPoints(fCurrentDetector, iServ), 
                                                kDP, multiSplit);
@@ -1952,14 +1980,14 @@ AliShuttleLogbookEntry* AliShuttle::QueryRunParameters(Int_t run)
 
        Bool_t skip = kFALSE;
                                
-       if (totEvents <= 1) 
+       if (endTime != 0 && endTime >= now - dcsDelay)
        {
-               Log("SHUTTLE", Form("QueryRunParameters - Run %d has 1 event or less - Skipping!", run));
-               skip = kTRUE;
+               Log("SHUTTLE", Form("Skipping run %d for now, because DCS buffer time is not yet expired", run));
        }
-       else if (endTime != 0 && endTime >= now - dcsDelay)
+       else if (totEvents <= 1) 
        {
-               Log("SHUTTLE", Form("Skipping run %d for now, because DCS buffer time is not yet expired", run));
+               Log("SHUTTLE", Form("QueryRunParameters - Run %d has 1 event or less - Skipping!", run));
+               skip = kTRUE;
        }
        else
        {