lhotari commented on issue #10433: URL: https://github.com/apache/pulsar/issues/10433#issuecomment-832414104
> @lhotari Let me poke into this theory: > > Initial refCnt of the entry in cache == 1 > > > one thread reads entries from the cache. the entries get marked for use with the value.retain(); call (line 115 in RangeCache). > > A: value.retain() succeeds: refCnt++ == 2 > B: value.retain() throws (other thread released it already somehow): entry is not returned. > > > in the meantime, the cache entry gets invalidated and invalidation calls release() for the entry > > A: refCnt-- == 1 > B: entry was not returned, could not be used > > "the EntryImpl instance gets returned to the Recycler object pool" does not happen in case A. > > Did I miss something there? @dlg99 yes, you are right that it's not possible in the way that I first explained it. There's a more recent comment about the races in invalidating the entries which could lead to a somewhat similar situation. The referenced PR contains more discussion about the possible explanations. -- 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]
