cms-sw/cmssw — pull request #6235 by bbockelm (2014-11-06 10:25:03+00:00)
Title: Allow the XrdFile to close quickly

Previously, the XrdFile close would not finish until the OpenHandler returned.

Accordingly - if there was a random probe for new sources occurring which was taking a long amount of time (timeout is 180 seconds by default), then the XrdFile::close() call would take up to 180 seconds. This was especially irritating as we would just throw away the results of the OpenHandler.

With this, when XrdRequestManager's destructor fires, we pass ownership of the OpenHandler object to itself. Then, when the callback fires, the object will delete itself.

Note the use of shared_ptr in XrdRequestManager::OpenHandler::GiftSelf to prevent the deletion of the object while GiftSelf is running (if the callback fires concurrently).

This allows the OpenHandler to be destroyed completely asynchronously from the XrdRequestManager, making shutdown much faster.