nevzheng opened a new pull request, #14149:
URL: https://github.com/apache/gravitino/pull/14149
<!-- claude-projects-attribution: {"github_login":"nevzheng"} -->
_Requested by **Nevin**_
### What changes were proposed in this pull request?
- **Fix:** `shutdown()` now ends with `clearComponents()`, which sets every
component field back to
its initial value after closing them.
- **Tests:** new `TestGravitinoEnvShutdown` checks that an injected
authorizer, internal access
control dispatcher and metrics system are gone after `shutdown()`. The KMS
and secret registry
tests now expect their getters to throw after shutdown instead of
returning the closed instance.
### Why are the changes needed?
A closed component left in the singleton leaks into whatever runs next in
the JVM. The test-side
fixes in #14099, #14100 and #14102 work around three symptoms; this removes
the cause.
Fix: #14148
### Does this PR introduce _any_ user-facing change?
No. After `shutdown()`, getters return null or throw instead of returning
closed components.
`GravitinoServer.stop()` calls `shutdown()` after the HTTP server stops, so
no request sees the
cleared state.
### How was this patch tested?
`./gradlew :core:test --tests 'org.apache.gravitino.TestGravitinoEnv*'`, and
the three reproductions
from #14099, #14100 and #14102 without their test-side fixes. Not run yet;
results will follow in a comment.
--
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]