merlimat commented on pull request #10480:
URL: https://github.com/apache/pulsar/pull/10480#issuecomment-834104386
> The problem here seems to be that invalidateAllEntries will call
.release() and then the callback.readEntryFailed will also call .release() for
the same set of entries and this leads to the "double release"
I don't think there's a double release because:
1. `invalidateAllEntries` is invalidating, thus removing and releasing the
entries kept in cache
2. `callback.readEntryFailed` is releasing entries that were already out of
the cache. We're just release the additional ref-count that was added when the
entry came out of the cache (since we're not going to use the entry).
The main traits of the entry cache are:
1. The cache has ownership of the entry and keeps 1 ref-count when the
entry is cached.
2. To grab an entry from the cache, we try to `retain()` (which might throw
if the entry is being deallocated)
3. To invalidate, entries have to first get removed from the map and then
release 1 ref-count
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]