You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Server] Test the SIGTERM shutdown path in a forked JVM #2064
Add an automated test for what happens when the server process gets SIGTERM. Today nothing fails if the shutdown hook in UnityCatalogServer.main, or the exec in bin/start-uc-server, is removed: UnityCatalogServerShutdownTest calls close() directly, so it never runs the JVM hook or the other libraries' own hooks at JVM exit.
Why
#2059 makes SIGTERM drain in-flight requests and then run close(). Two problems in that path only showed up by running the process and sending SIGTERM by hand:
Log4j's own JVM hook stopped logging while requests were still draining.
H2's own JVM hook closed the file database during the drain, so a request that touched the database after SIGTERM failed (fixed with DB_CLOSE_ON_EXIT=FALSE).
A test would catch these, and future regressions, in CI.
Suggested approach
A forked-JVM test in the server module:
A small test main builds the server on an H2 file URL, with a credential vendor that waits a fixed time and then queries the database.
The test starts it with ProcessBuilder, sends a request that reaches the slow vendor, then calls process.destroy() (SIGTERM) while the request is in flight.
It asserts that the request returns 200 and that the process exits with code 143.
Activity
[Server] Shut down gracefully on SIGTERM (#2059)