coderbruis commented on PR #24292: URL: https://github.com/apache/kafka/pull/24292#issuecomment-7015714823
@shihchengwei-lab Thanks for catching this, you were right. An entry evicted during `init()` was only referenced by its delayed cleanup task. `shutdown()` discards that task, and the catch block only closed entries still in the cache, leaving the evicted entry's indexes open. The same gap also existed in `close()`. I've updated the PR to track entries whose cleanup has not completed. When the cleaner stops, on `close()` or an initialization failure, those entries are closed together with the cached ones. `testInitializationFailureClosesEntriesEvictedDuringInitialization` reproduces the sequence you described: the first restored entry is evicted, then restoring the next segment fails. It verifies that the evicted entry's indexes are closed and its delayed cleanup task never ran. The update also covers related resource leaks on these paths, with targeted tests. The details are in the updated description. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
