]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Some warning going to error and viceversa:
authorrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Mar 2013 11:05:59 +0000 (11:05 +0000)
committerrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Mar 2013 11:05:59 +0000 (11:05 +0000)
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.

STEER/CDB/AliCDBLocal.cxx
STEER/CDB/AliCDBManager.cxx
STEER/STEER/AliReconstruction.cxx

index 1b917367de58caaa16087598390b0b016c71dc49..03347affee544e67c903d5c4bb46fcbe61c5eaba 100644 (file)
@@ -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<AliCDBEntry*> (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());
index 0957854ec1cbb1217255a841b8254a8004923f67..4c94031d2cee47f817d6ff63a35d99b121eae3b6 100644 (file)
@@ -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;
index 2ca62afcb6e6cdf4706c6c533f2bd560b58e53a4..6eaaa94ddc3fe4667463860cd2f825730ee54eef 100644 (file)
@@ -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) {