From f4e8a0bf9214e39145e4f75293675062f416605e Mon Sep 17 00:00:00 2001 From: Alja Mrak-Tadel Date: Sun, 5 Jul 2015 10:06:19 -0700 Subject: [PATCH] Removed failed prefetched block in ProcessRequest(). --- src/XrdFileCache/XrdFileCacheFile.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/XrdFileCache/XrdFileCacheFile.cc b/src/XrdFileCache/XrdFileCacheFile.cc index 6f35c4f28ba..0d447de80cd 100644 --- a/src/XrdFileCache/XrdFileCacheFile.cc +++ b/src/XrdFileCache/XrdFileCacheFile.cc @@ -736,11 +736,6 @@ void File::ProcessBlockResponse(Block* b, XrdCl::XRootDStatus *status) inc_ref_count(b); cache()->AddWriteTask(b, true); } - else { - if (b->m_prefetch && ( b->m_refcnt == 0)) { - m_block_map.erase((int)(b->m_offset/BufferSize())); - } - } } else { @@ -752,10 +747,18 @@ void File::ProcessBlockResponse(Block* b, XrdCl::XRootDStatus *status) b->set_error_and_free(errno); errno = 0; - // ??? AMT temprary commented out + // ??? AMT temprary commented out -- throw away failed attempts // inc_ref_count(b); } + + // case when there is a prefetch that is failed or prefetch that stopped has just been initated + if (b->m_refcnt == 0) { + assert(b->m_prefetch); + m_block_map.erase((int)(b->m_offset/BufferSize())); + } + + m_downloadCond.Broadcast(); m_downloadCond.UnLock();