diff --git a/src/XrdApps/XrdClJCachePlugin/file/CacheStats.hh b/src/XrdApps/XrdClJCachePlugin/file/CacheStats.hh index 8989f4c9136..bbbe4c5e25b 100644 --- a/src/XrdApps/XrdClJCachePlugin/file/CacheStats.hh +++ b/src/XrdApps/XrdClJCachePlugin/file/CacheStats.hh @@ -53,6 +53,7 @@ struct CacheStats { struct timeval now; gettimeofday(&now, nullptr); startTime = now.tv_sec + now.tv_usec / 1000000.0; + dumperInterval=0; } ~CacheStats() { diff --git a/src/XrdApps/XrdClJCachePlugin/file/XrdClJCacheFile.cc b/src/XrdApps/XrdClJCachePlugin/file/XrdClJCacheFile.cc index 96c2e633648..53a52215016 100644 --- a/src/XrdApps/XrdClJCachePlugin/file/XrdClJCacheFile.cc +++ b/src/XrdApps/XrdClJCachePlugin/file/XrdClJCacheFile.cc @@ -192,10 +192,10 @@ XRootDStatus JCacheFile::Stat(bool force, ResponseHandler *handler, if (pFile) { if (!force && mOpenAsync) { - // let's create a stat response using the cache - AnyObject *obj = new AnyObject(); - std::string id = pUrl; if (sEnableJournalCache && AttachForRead() && mOpenAsync) { + // let's create a stat response using the cache + AnyObject *obj = new AnyObject(); + std::string id = pUrl; auto statInfo = new StatInfo(id, pJournal->getHeaderFileSize(), 0, pJournal->getHeaderMtime()); obj->Set(statInfo); XRootDStatus *ret_st = new XRootDStatus(XRootDStatus(stOK, 0)); @@ -577,10 +577,12 @@ bool JCacheFile::AttachForRead() { mLog->Error(1, "JCache : failed to attach to cache file: %s", pJournalPath.c_str()); mAttachedForRead = true; + delete sinfo; return false; } else { mLog->Info(1, "JCache : attached to cache file: %s", pJournalPath.c_str()); + delete sinfo; } } } diff --git a/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCachePgReadHandler.hh b/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCachePgReadHandler.hh index 7c4fb3bedda..595b5bc2409 100644 --- a/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCachePgReadHandler.hh +++ b/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCachePgReadHandler.hh @@ -63,6 +63,7 @@ public: } } handler->HandleResponse(pStatus, pResponse); + delete this; } XrdCl::ResponseHandler *handler; diff --git a/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCacheReadHandler.hh b/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCacheReadHandler.hh index baaf9178619..e6fdb608de8 100644 --- a/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCacheReadHandler.hh +++ b/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCacheReadHandler.hh @@ -63,6 +63,7 @@ public: } } handler->HandleResponse(pStatus, pResponse); + delete this; } XrdCl::ResponseHandler *handler;