Skip to content

Commit

Permalink
InitateClose(): Don't remove this blocks from global write queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
alja authored and abh3 committed Jun 30, 2016
1 parent 03dadf4 commit 2cb7896
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/XrdFileCache/XrdFileCacheFile.cc
Expand Up @@ -95,6 +95,7 @@ m_prefetchCurrentCnt(0)
if (!Open()) {
clLog()->Error(XrdCl::AppMsg, "File::File() Open failed %s !!!", m_input->Path());
}
printf("AMT open ended in File\n");
}

void File::BlockRemovedFromWriteQ(Block* b)
Expand Down Expand Up @@ -153,7 +154,6 @@ bool File::InitiateClose()
// Retruns true if delay is needed
clLog()->Debug(XrdCl::AppMsg, "File::Initiate close start %s", lPath());


m_stateCond.Lock();
bool firsttime = false;
if (!m_stopping) {
Expand All @@ -164,15 +164,20 @@ bool File::InitiateClose()
}
m_stateCond.UnLock();

if (firsttime) cache()->RemoveWriteQEntriesFor(this);

m_stateCond.Lock();
bool isPrefetching = (m_prefetchCurrentCnt > 0);
m_stateCond.UnLock();

if (isPrefetching == false)
{
m_downloadCond.Lock();
/*
for (BlockMap_i it = m_block_map.begin(); it != m_block_map.end(); ++it) {
Block* b = it->second;
clLog()->Debug(XrdCl::AppMsg, "File::InitiateClose() block idx=%d p=%d rcnt=%d dwnd=%d %s",
b->m_offset/m_cfi.GetBufferSize(), b->m_prefetch, b->m_refcnt, b->m_downloaded, lPath());
}
*/
// remove failed blocks
BlockMap_i itr = m_block_map.begin();
while (itr != m_block_map.end()) {
Expand All @@ -185,6 +190,7 @@ bool File::InitiateClose()
++itr;
}
}

bool blockMapEmpty = m_block_map.empty();
m_downloadCond.UnLock();

Expand Down Expand Up @@ -259,8 +265,6 @@ bool File::Open()
}
else
{
m_fileSize = m_cfi.GetSizeInBits();
printf("%lld file size \n", m_fileSize);
clLog()->Debug(XrdCl::AppMsg, "Info file read from disk: %s", m_input->Path());
}

Expand Down Expand Up @@ -641,7 +645,6 @@ int File::Read(char* iUserBuff, long long iUserOff, int iUserSize)

delete direct_handler;
}
clLog()->Debug(XrdCl::AppMsg, "File::Read() before assert %s.", lPath());
assert(iUserSize >= bytes_read);

// Last, stamp and release blocks, release file.
Expand Down

0 comments on commit 2cb7896

Please sign in to comment.