Print

Print


Well, my question is based on the patch. So, it would seem that the patch does not make it possible to call Detach() more than once. While he patch appears to be technically correct, it seems like winds up involving delayed destroy when it need not and that was somewhat confusing relative to Detach(). David did you consider this variation to avoid delayed destroy?

fP->Ref();
if (fP->XCio->Detach((XrdOucCacheIOCD&)*fP)) fP->Unref();
if (fP->Refs() < 2)
   {if ((ret = fP->Close(Status))) {delete fP; fP = 0;}
.... Rest of the code is the same, ending with
   } else {
     ret = true;
   }

Note that we no longer need dnocb nor the unref should it be true as this is taken care of inline and allowing the close to proceed if we are the only reference. However, it will still leave the file permanently in the queue if the close() fails as there will be no one to try it again. The original code had the same problem but I think it was done that way because it's unavoidable because XrdCl will leave that file in an undefined state so we can't close it again. Other than that, does this variation look right?
    


-- 
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/pull/1724#issuecomment-1160968457
You are receiving this because you are subscribed to this thread.

Message ID: <[log in to unmask]>

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1