From: rgrosso Date: Tue, 5 Mar 2013 11:05:59 +0000 (+0000) Subject: Some warning going to error and viceversa: X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=e9ce6cb702e1747bf6f882e4880c1f8cd5c969af;p=u%2Fmrichter%2FAliRoot.git Some warning going to error and viceversa: 1) When unloading an object from the cache, prompt just a warning and not an error if the object is not in the cache. In particular in reconstruction, first check for some objects if they are in the cache before asking to unload them. 2) Prompt an error instead of a debug message just before throwing an exception in AliCDBLocal::GetEntry, in the case of missing entry. The cause of the abort will like this be clear also in systems which are not able to prompt the error message of the runtime error. --- diff --git a/STEER/CDB/AliCDBLocal.cxx b/STEER/CDB/AliCDBLocal.cxx index 1b917367de5..03347affee5 100644 --- a/STEER/CDB/AliCDBLocal.cxx +++ b/STEER/CDB/AliCDBLocal.cxx @@ -515,14 +515,14 @@ AliCDBEntry* AliCDBLocal::GetEntry(const AliCDBId& queryId) { TString errMessage(TString::Format("No valid CDB object found! request was: %s", queryId.ToString().Data())); if (!dataId || !dataId->IsSpecified()){ + AliError(Form("The data ID is undefined!")); throw std::runtime_error(errMessage.Data()); return NULL; } TString filename; if (!IdToFilename(*dataId, filename)) { - - AliDebug(2,Form("Bad data ID encountered! Subnormal error!")); + AliError(Form("Bad data ID encountered!")); delete dataId; throw std::runtime_error(errMessage.Data()); return NULL; @@ -530,7 +530,7 @@ AliCDBEntry* AliCDBLocal::GetEntry(const AliCDBId& queryId) { TFile file(filename, "READ"); // open file if (!file.IsOpen()) { - AliDebug(2,Form("Can't open file <%s>!", filename.Data())); + AliError(Form("Can't open file <%s>!", filename.Data())); delete dataId; throw std::runtime_error(errMessage.Data()); return NULL; @@ -541,7 +541,7 @@ AliCDBEntry* AliCDBLocal::GetEntry(const AliCDBId& queryId) { AliCDBEntry* anEntry = dynamic_cast (file.Get("AliCDBEntry")); if (!anEntry) { - AliDebug(2,Form("Bad storage data: No AliCDBEntry in file!")); + AliError(Form("Bad storage data: No AliCDBEntry in file!")); file.Close(); delete dataId; throw std::runtime_error(errMessage.Data()); diff --git a/STEER/CDB/AliCDBManager.cxx b/STEER/CDB/AliCDBManager.cxx index 0957854ec1c..4c94031d2ce 100644 --- a/STEER/CDB/AliCDBManager.cxx +++ b/STEER/CDB/AliCDBManager.cxx @@ -1445,7 +1445,7 @@ void AliCDBManager::UnloadFromCache(const char* path){ delete fIds->Remove(id); }*/ } else { - AliError(Form("Cache does not contain object \"%s\"!", path)); + AliWarning(Form("Cache does not contain object \"%s\"!", path)); } AliDebug(2, Form("Cache entries: %d",fEntryCache.GetEntries())); return; diff --git a/STEER/STEER/AliReconstruction.cxx b/STEER/STEER/AliReconstruction.cxx index 2ca62afcb6e..6eaaa94ddc3 100644 --- a/STEER/STEER/AliReconstruction.cxx +++ b/STEER/STEER/AliReconstruction.cxx @@ -1564,7 +1564,10 @@ void AliReconstruction::Begin(TTree *) Abort("MisalignGeometry", TSelector::kAbortProcess); return; } - AliCDBManager::Instance()->UnloadFromCache("GRP/Geometry/Data"); + + const TMap* cdbCache = AliCDBManager::Instance()->GetEntryCache(); + if(cdbCache->Contains("GRP/Geometry/Data")) + AliCDBManager::Instance()->UnloadFromCache("GRP/Geometry/Data"); if(!toCDBSnapshot) AliCDBManager::Instance()->UnloadFromCache("*/Align/*"); AliSysInfo::AddStamp("MisalignGeom"); @@ -1573,7 +1576,9 @@ void AliReconstruction::Begin(TTree *) return; } AliSysInfo::AddStamp("InitGRP"); - if(!toCDBSnapshot) AliCDBManager::Instance()->UnloadFromCache("GRP/Calib/CosmicTriggers"); + if(!toCDBSnapshot) + if(cdbCache->Contains("GRP/Calib/CosmicTriggers")) + AliCDBManager::Instance()->UnloadFromCache("GRP/Calib/CosmicTriggers"); if(!fCDBSnapshotMode || toCDBSnapshot){ if (!LoadCDB()) { @@ -1611,7 +1616,8 @@ void AliReconstruction::Begin(TTree *) { AliCDBManager::Instance()->DumpToSnapshotFile(snapshotFileOut.Data(),kFALSE); AliCDBManager::Instance()->UnloadFromCache("*/Align/*"); - AliCDBManager::Instance()->UnloadFromCache("GRP/Calib/CosmicTriggers"); + if(cdbCache->Contains("GRP/Calib/CosmicTriggers")) + AliCDBManager::Instance()->UnloadFromCache("GRP/Calib/CosmicTriggers"); } if (fInput && gProof) {