feat(capture): expose Hyper server loop directly to control/observe graceful shutdown
Problem
We want more app level control over graceful shutdown of capture's Axum server during deploy cutovers.
Changes
- Expose underlying Hyper server builder plumbing
- Control graceful shutdown timeout and observe actual behavior of Hyper-managed connections on shutdown
How did you test this code?
Locally, CI, mirror deploy smoke test
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Changelog: (features only) Is this feature complete?
N/A
Wiz Scan Summary
| Scanner | Findings |
|---|---|
| 3 |
|
| - | |
| - | |
| - | |
| - | |
| Total | 3 |
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.
Tested in mirror today. Sadly, none of the new metrics or logs emitted on shutdown. I'm looking into why (I assume final metrics/log flush isn't making it out as the shutdown handler is triggered very late in the game but still digging.)
This change could still be useful if we need control to drain queued connections prior to shutdown to solve the root cause of the conn closed issue w/Envoy definitively. In the meantime, I'm putting this back in draft and testing the PR I expect to actually fix that problem (correcting _readiness probe behavior)
Closing this in favor of more robust, rebased impl here