cms-sw/cmssw — pull request #2371 by wmtan (2014-02-08 00:32:46+00:00)
Title: Propagate exceptions from TFile opening

This is a fix for numerous relval failures in the ROOT6 branch. It is being queued to the main 7_1_X because it is 100% compatible with ROOT5.
ROOT6 cannot propagate exceptions across the just-in-time interpreter, which is used every time cmsRun opens a TFile. This means that, if a file cannot be opened for any reason, our TFileAdaptor throws an exception, which JIT makes into a call to terminate(). This fix uses a thread local static std::exception_ptr to
store the exception instead of immediately throwing it. Then the caller of TFile::Open can check if there was an exception and rethrow it.
Attempts to open a TFile outside of cmsRun jobs do not have this problem, because they use the standard ROOT adaptor, which does not throw.
This request has been tested with the short relval matrix. There were no errors.
Please merge this in a timely manner after testing and after it is signed.