smengcl commented on code in PR #11894:
URL: https://github.com/apache/ozone/pull/11894#discussion_r4437499578
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -565,6 +565,7 @@ public void stop() throws IOException {
LOG.error("Error closing hierarchical lock manager", e);
}
tableCacheMetricsMap.values().forEach(TableCacheMetrics::unregister);
+ tableMap.values().forEach(Table::closeCache);
Review Comment:
Thanks for pointing this out. The race between
`OzoneManagerServiceProviderImpl.stop()` and a running sync is there already
without this change: `stop()` closes the store and walks
`tableCacheMetricsMap`, which `TableInitializer.get()` mutates in the same call
that updates `tableMap`, so the new loop adds no new failure mode. Fixing the
ordering needs the scheduler stopped and awaited before
`omMetadataManager.stop()`, which seems better as a separate Recon change, so I
kept this PR scoped to the leaked executors.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/cache/PartialTableCache.java:
##########
@@ -106,6 +106,11 @@ public void cleanup(List<Long> epochs) {
executorService.execute(() -> evictCache(epochs));
}
+ @Override
+ public void close() {
+ executorService.shutdown();
+ }
Review Comment:
The queued evictions are bounded: on OM install and stop the double buffer
is flushed and stopped before the metadata manager is stopped, so no `cleanup`
is submitted after `close()`, and Recon never calls `cleanupCache`. The
remaining tasks are short in-memory evictions, so the thread ends right after
them. The "no cleanup may follow" note in `TableCache.close()` is the contract
for callers. Happy to switch to `shutdownNow()` if you prefer dropping them.
_🤖 Addressed by [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]