mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
Shutdown hooks could not reach Floci's HTTP endpoint (e.g. `aws --endpoint-url http://localhost:4566 ...`) because they ran in the ShutdownEvent observer, which Quarkus fires only AFTER the HTTP server has already stopped. Split the lifecycle: - onPreShutdown(@Observes ShutdownDelayInitiatedEvent) runs stop hooks while the HTTP server is still accepting connections. - onStop(@Observes ShutdownEvent) handles resource cleanup only. Enable the pre-shutdown phase via `quarkus.shutdown.delay-enabled: true`. No `delay` value is set, so observers run synchronously with no artificial sleep introduced. Swallow all hook failures (including InterruptedException) without restoring the interrupt flag, so the subsequent ShutdownEvent cleanup phase always runs with a clean thread state and resource shutdown is guaranteed even when hooks fail. Fixes floci-io/floci#431