Skip to content

SGTools: Simplify unbinding a Handle from a proxy.

Scott Snyder requested to merge ssnyder/athena:unbind.SGTools-20240401 into 24.0

A DataProxy contains a list of bound Handles, and when a Handle is deleted, it needs to remove itself from that list. But there was apparently a problematic case where the deletion of a Handle could be triggered while the proxy was iterating over the list of bound Handles. Erasing the pointer to the Handle immediately could then invalidate the iterator being used.

This was fixed in this change by not erasing the entry from the Handle list immediately.

    2015-02-03  Paolo Calafiura  <calaf@lxplus0019.cern.ch>
    
            * Tagging SGTools-00-24-07
            * src/DataProxy.cxx (finalReset): handle correctly proxy and handles
            deletion

Instead, the entry gets overwritten with a null pointer. The null entries are actually removed from the list at the end of the event when the proxy is reset.

However, this was causing an issue when Handles were being bound on each event to a proxy in the detector store. In this case, the store is never cleared, so the entries were never getting removed from the list of bound Handles. Eventually, this resulted in a serious performance degredation.

However, as part of the MT changes, the loops the proxy makes over the Handles were changed so that we first make a copy of the list and iterate over that. So there is no longer an issue with a Handle getting deleted during this iteration. So remove the logic that did this and return to the entry being removed from the list immediately when a Handle is unbound.

See ATEAM-971.

Merge request reports

Loading