From 18c05d872115368a10d50d6faa11aebf102d96b4 Mon Sep 17 00:00:00 2001
From: Eric Cano <Eric.Cano@cern.ch>
Date: Wed, 11 Feb 2015 17:38:53 +0100
Subject: [PATCH] Fixed wrong creation of recall job and added missing printout
 of exception.

---
 objectstore/Action.hpp            | 7 +++----
 objectstore/FIFO.hpp              | 8 ++++----
 objectstore/ObjectStoreChoice.hpp | 2 +-
 objectstore/RecallJob.hpp         | 2 +-
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/objectstore/Action.hpp b/objectstore/Action.hpp
index ef8e53d613..76f2990ced 100644
--- a/objectstore/Action.hpp
+++ b/objectstore/Action.hpp
@@ -95,8 +95,9 @@ public:
           std::cout << "The recall FIFO was empty for more than a second. Exiting." << std::endl;
           break;
         }
-        usleep(100 * 1000);
-      } catch (std::exception&) {
+        usleep(10 * 1000);
+      } catch (std::exception& e) {
+        std::cout << "Got exception while getting a recall job:" << e.what() << std::endl;
       } catch (...) {
         throw;
       }
@@ -215,8 +216,6 @@ private:
       for (std::list<AgentVisitor::ownershipEntry>::iterator i=ownedObjects.begin();
               i != ownedObjects.end(); i++) {
         collectOwnedObject(*i);
-        std::cout << "Considering owned object " << i->name 
-                << " (type:" << i->objectType << ")" << std::endl;
       }
       // print the recall FIFO
       std::cout << "Recall FIFO after garbage collection:" << std::endl;
diff --git a/objectstore/FIFO.hpp b/objectstore/FIFO.hpp
index 249f2c0d9b..a78bb77ccc 100644
--- a/objectstore/FIFO.hpp
+++ b/objectstore/FIFO.hpp
@@ -91,10 +91,10 @@ public:
     ret<< "<<<< FIFO dump start" << std::endl
       << "Read pointer=" << fs.readpointer() << std::endl
       << "Array size=" << fs.name_size() << std::endl;
-    for (int i=fs.readpointer(); i<fs.name_size(); i++) {
-      ret << "name[phys=" << i << " ,log=" << i-fs.readpointer()
-          << "]=" << fs.name(i) << std::endl;
-    }
+//    for (int i=fs.readpointer(); i<fs.name_size(); i++) {
+//      ret << "name[phys=" << i << " ,log=" << i-fs.readpointer()
+//          << "]=" << fs.name(i) << std::endl;
+//    }
     ret<< ">>>> FIFO dump end." << std::endl;
     return ret.str();
   }
diff --git a/objectstore/ObjectStoreChoice.hpp b/objectstore/ObjectStoreChoice.hpp
index dd5d9b1636..49d46d6e16 100644
--- a/objectstore/ObjectStoreChoice.hpp
+++ b/objectstore/ObjectStoreChoice.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
 #include "ObjectOps.hpp"
-#define USE_RADOS 0
+#define USE_RADOS 1
 #if USE_RADOS
 typedef cta::objectstore::ObjectStoreRados myOS;
 #else
diff --git a/objectstore/RecallJob.hpp b/objectstore/RecallJob.hpp
index 18311a5a8b..e565145495 100644
--- a/objectstore/RecallJob.hpp
+++ b/objectstore/RecallJob.hpp
@@ -16,7 +16,7 @@ public:
     rjs.set_status("OK");
     std::string ret = agent.nextId("RecallJob");
     agent.addToIntend(container, ret, serializers::RecallJob_t);
-    agent.objectStore().atomicOverwrite(ret, rjs.SerializeAsString());
+    agent.objectStore().create(ret, rjs.SerializeAsString());
     return ret;
   }
   
-- 
GitLab