smengcl opened a new pull request, #11896:
URL: https://github.com/apache/ozone/pull/11896

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   Snapshot and checkpoint DBs are opened through 
`OmMetadataManagerImpl#initializeOmTables` with `PARTIAL_CACHE`. A table that 
hardcodes `FULL_CACHE` there instead of using the `cacheType` argument loads 
the whole table and starts a `FullTableCache` cleanup thread on every snapshot 
DB open, and that thread is never shut down (HDDS-17460). HDDS-14091 did this 
for `s3RevokedStsTokenTable`; master got the fix in the STS branch merge 
f7c62ae2329 without anything to stop it from coming back.
   
   This PR:
   - makes `TableInitializer` throw when a table asks for `FULL_CACHE` in a DB 
opened with `PARTIAL_CACHE`, so the mistake fails on the first snapshot DB open 
in any test
   - adds `TestOmMetadataManager#testSnapshotDbOpenLeaksNoThread`, which opens 
and closes a snapshot DB and a checkpoint DB ten times and checks that no 
thread is left behind
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17655
   
   ## How was this patch tested?
   
   `TestOmMetadataManager`, `TestOmMetadataManagerMetrics`, 
`TestOmSnapshotManager` and `TestSnapshotCache` pass. With 
`s3RevokedStsTokenTable` changed back to `CacheType.FULL_CACHE`, the new test 
fails with `Table s3RevokedStsTokenTable must not use FULL_CACHE in a DB opened 
with PARTIAL_CACHE`. Without the guard, the same change makes it fail and list 
the 20 leaked `s3RevokedStsTokenTable_FullTableCache-Cleanup-0` threads.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to