HiveWhiteBoard::freeStore() bug when called for already-free store
While implementing some error handling in ATLAS HLT event loop manager, I found a HiveWhiteBoard behaviour which I didn't expect and which I believe is a bug. In the way HiveWhiteBoard::freeStore
is written:
https://gitlab.cern.ch/gaudi/Gaudi/blob/master/GaudiHive/src/HiveWhiteBoard.cpp#L593
when you try to free a store number N, which was already freed before, it pushes the number N into the vector of free store indices (which is actually a tbb::concurrent_queue<size_t>
) without checking if it's already there. After you do this, the freeSlots()
method will return an incorrect number, which may be larger than the number of available stores.
My example was:
- I had 2 event slots, both free at the beginning
- I made the first event fail in a way, where I want to clear all slots and try to continue processing events
- I made a loop over slots (i.e. {0, 1}) and called
wb->clearStore(i)
andwb->freeStore(i)
for each slot; here slot 0 was not free, but slot 1 was already free (not yet in use) - I called
wb->freeSlots()
afterwards and it returned 3
Edited by Rafal Bielski