yuqi1129 commented on code in PR #12146:
URL: https://github.com/apache/gravitino/pull/12146#discussion_r3643814736
##########
core/src/main/java/org/apache/gravitino/GravitinoEnv.java:
##########
@@ -583,7 +583,7 @@ public void start() {
}
/** Shutdown the Gravitino environment. */
- public void shutdown() {
+ public synchronized void shutdown() {
Review Comment:
Agreed. I removed the synchronized changes from GravitinoEnv and updated the
PR description to make awaitTermination the lifecycle barrier.
##########
integration-test-common/src/test/java/org/apache/gravitino/integration/test/MiniGravitino.java:
##########
@@ -220,6 +220,13 @@ public void stop() throws IOException,
InterruptedException {
sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
executor.shutdownNow();
+ // The HTTP port may be closed before GravitinoServer.main() finishes
shutting down the
+ // singleton GravitinoEnv. Wait for the server task to terminate so the
next embedded server
+ // cannot initialize the same environment while this shutdown is still in
progress.
+ if (!executor.awaitTermination(3, TimeUnit.MINUTES)) {
Review Comment:
Fixed in 73460081d. Resource cleanup now runs in finally. The original
timeout or interruption remains the primary failure, and an IOException from
closing the REST client is attached as a suppressed exception. Added tests for
both timeout cleanup and interrupted cleanup.
--
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]