roryqi commented on code in PR #11364:
URL: https://github.com/apache/gravitino/pull/11364#discussion_r3341687716
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/RESTService.java:
##########
@@ -198,6 +220,7 @@ public void serviceInit(Map<String, String> properties,
boolean auxMode) {
@Override
public void serviceStart() {
icebergMetricsManager.start();
+ cleanupManager.ifPresent(IcebergCleanupManager::start);
if (server != null) {
Review Comment:
Good catch — fixed. `serviceStart()` now stops the cleanup manager in the
`catch` block before rethrowing, so its workers do not outlive a failed startup:
```java
} catch (Exception e) {
// Stop the cleanup workers we just started so they don't outlive a failed
startup.
cleanupManager.ifPresent(IcebergCleanupManager::close);
throw new RuntimeException(e);
}
```
(The worker/scheduler threads are daemon threads, so they would not block
JVM exit, but stopping them keeps a failed start from leaking running threads.)
--
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]