Skip to content

Commit

Permalink
Return different values depending on the type of failure
Browse files Browse the repository at this point in the history
Have TBasket::ReadBasketBuffers return different values for each
of the different error cases. This will help diagnose run-time
problems as the error code is printed in the Error messages.
  • Loading branch information
Dr15Jones authored and smuzaffar committed May 25, 2022
1 parent b5aa8fd commit 556667e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tree/tree/src/TBasket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ Int_t TBasket::ReadBasketBuffers(Long64_t pos, Int_t len, TFile *file)
st = pf->ReadBuffer(readBufferRef->Buffer(),pos,len);
}
if (st < 0) {
return 1;
return 2;
} else if (st == 0) {
// Read directly from file, not from the cache
// If we are using a TTreeCache, disable reading from the default cache
Expand All @@ -535,7 +535,7 @@ Int_t TBasket::ReadBasketBuffers(Long64_t pos, Int_t len, TFile *file)
pf->AddNoCacheBytesRead(len);
pf->AddNoCacheReadCalls(1);
if (ret) {
return 1;
return 3;
}
}
gPerfStats = temp;
Expand All @@ -546,13 +546,13 @@ Int_t TBasket::ReadBasketBuffers(Long64_t pos, Int_t len, TFile *file)
R__LOCKGUARD_IMT(gROOTMutex); // Lock for parallel TTree I/O
if (file->ReadBuffer(readBufferRef->Buffer(),pos,len)) {
gPerfStats = temp;
return 1;
return 4;
}
else gPerfStats = temp;
}
Streamer(*readBufferRef);
if (IsZombie()) {
return 1;
return 5;
}

rawCompressedBuffer = readBufferRef->Buffer();
Expand Down Expand Up @@ -590,6 +590,7 @@ Int_t TBasket::ReadBasketBuffers(Long64_t pos, Int_t len, TFile *file)
// Case where ROOT thinks the buffer is compressed. Copy over the key and uncompress the object
if (fObjlen > fNbytes-fKeylen || oldCase) {
if (R__unlikely(TestBit(TBufferFile::kNotDecompressed) && (fNevBuf==1))) {
//always returns 0
return ReadBasketBuffersUncompressedCase();
}

Expand Down Expand Up @@ -631,7 +632,7 @@ Int_t TBasket::ReadBasketBuffers(Long64_t pos, Int_t len, TFile *file)
if (R__unlikely(noutot != fObjlen)) {
Error("ReadBasketBuffers", "fNbytes = %d, fKeylen = %d, fObjlen = %d, noutot = %d, nout=%d, nin=%d, nbuf=%d", fNbytes,fKeylen,fObjlen, noutot,nout,nin,nbuf);
fBranch->GetTree()->IncrementTotalBuffers(fBufferSize);
return 1;
return 6;
}
len = fObjlen+fKeylen;
TVirtualPerfStats* temp = gPerfStats;
Expand Down

0 comments on commit 556667e

Please sign in to comment.