From: zampolli Date: Wed, 29 Oct 2014 11:46:10 +0000 (+0100) Subject: Enlarging window for DCS DPs retrieval for short runs for GRP + Keeping connection... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=22eca20c6d191b28e341c5249c7b8cf245189e74;hp=552957f34fcaa57da993551331336c6486d71398;p=u%2Fmrichter%2FAliRoot.git Enlarging window for DCS DPs retrieval for short runs for GRP + Keeping connection to grid alive when no activity is there --- diff --git a/SHUTTLE/AliShuttle.cxx b/SHUTTLE/AliShuttle.cxx index 45f2b8d4b59..4c0438a05fe 100644 --- a/SHUTTLE/AliShuttle.cxx +++ b/SHUTTLE/AliShuttle.cxx @@ -2140,19 +2140,25 @@ TMap* AliShuttle::GetValueSet(const char* host, Int_t port, const TSeqCollection AliDCSClient client(host, port, fTimeout, fRetries, multiSplit); TMap* result = 0; + UInt_t startQuery = GetStartTimeDCSQuery(); + UInt_t endQuery = GetEndTimeDCSQuery(); + if (fCurrentDetector == "GRP" && (endQuery - startQuery) <= 120) { // enlarging DCS query for GRP when a run is shorter than 2 minutes (i.e. the time of forced archival of GRP DPs) + Log(fCurrentDetector.Data(), Form("GetValueSet: run lasting less than 120 seconds, enlarging DCS window for DPs retrival to 130 s")); + startQuery = endQuery - 130; // we add 130 s to be sure that there is something (even if the archival is forced after 120 s) + } + if (type == kAlias) { //result = client.GetAliasValues(entries, GetCurrentStartTime()-offset, // GetCurrentEndTime()+offset); - result = client.GetAliasValues(entries, GetStartTimeDCSQuery(), - GetEndTimeDCSQuery()); + + result = client.GetAliasValues(entries, startQuery, endQuery); } else if (type == kDP) { //result = client.GetDPValues(entries, GetCurrentStartTime()-offset, // GetCurrentEndTime()+offset); - result = client.GetDPValues(entries, GetStartTimeDCSQuery(), - GetEndTimeDCSQuery()); + result = client.GetDPValues(entries, startQuery, endQuery); } if (result == 0) diff --git a/SHUTTLE/AliShuttleTrigger.cxx b/SHUTTLE/AliShuttleTrigger.cxx index 9105d355944..732e60edf84 100644 --- a/SHUTTLE/AliShuttleTrigger.cxx +++ b/SHUTTLE/AliShuttleTrigger.cxx @@ -108,6 +108,7 @@ #include "AliShuttleTrigger.h" #include +#include #include #include "AliLog.h" @@ -247,9 +248,21 @@ void AliShuttleTrigger::Run() { fMutex.Lock(); while (!(fNotified || fTerminate)) { - received=fCondition.TimedWaitRelative(1000*fConfig->GetTriggerWait()); - CheckTerminate(); - if (received==1) break; // 1 = timeout + for (Int_t iwait = 0; iwait < 10; iwait++){ + received = fCondition.TimedWaitRelative(1000*fConfig->GetTriggerWait()/10); // to keep the connection to the server alive every minute while waiting for new runs + if (received == 1) { + if (gGrid) { + AliInfo(Form("Keeping the connection to the server alive while waiting for new runs - %d waited from last one", fConfig->GetTriggerWait()/10*iwait)); + gGrid->Pwd(); + } + else { + AliInfo("No gGrid initialized so far, we cannot keep the connection to the server alive while waiting for new runs"); + } + } + } + //received=fCondition.TimedWaitRelative(1000*fConfig->GetTriggerWait()); + CheckTerminate(); + if (received==1) break; // 1 = timeout } fNotified = kFALSE; @@ -372,7 +385,7 @@ Bool_t AliShuttleTrigger::SendMailDiskSpace(Short_t percentage) to.Remove(to.Length()-1); AliDebug(2, Form("to: %s",to.Data())); - // mail body + // mail body TString bodyFileName; bodyFileName.Form("%s/mail.body", fShuttle->GetShuttleLogDir()); gSystem->ExpandPathName(bodyFileName);