Repository navigation
fix: reuse readiness probe transport to prevent memory leaks - #1124
Open
oliverbaehler wants to merge 1 commit into
Open
oliverbaehler wants to merge 1 commit into
oliverbaehler wants to merge 1 commit into
Conversation
Signed-off-by: Oliver Baehler <oliver@sudo-i.net>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation is bounded, lifecycle-aware, and covered across unit, benchmark, and e2e levels.
0 open findings
What changed in this PR
Reuses a bounded readiness HTTP client to prevent transport resource leaks while preserving probe behavior.
Changes:
- Adds connection reuse, timeouts, response draining, and shutdown cleanup.
- Adds unit, benchmark, and tenant-aware e2e regression coverage.
- Documents the focused probes e2e suite.
Assessment: Connection growth is bounded to two per host; loopback-only insecure TLS remains isolated, and tenant authorization is regression-tested. Tests were inspected but not executed.
| File | Description |
|---|---|
internal/webserver/webserver.go |
Introduces and reuses the bounded readiness client. |
internal/webserver/probes_test.go |
Tests reuse, limits, cancellation, draining, and liveness behavior. |
e2e/probes_test.go |
Adds real-cluster leak and tenant-isolation regression coverage. |
e2e/README.md |
Documents probe-suite requirements and execution. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Readiness checks created a new HTTPS transport on every call, leaving idle connections, goroutines, and buffers retained indefinitely. Go 1.27’s automatic response draining exposed this leak.
Reuse a bounded readiness client with two connections, idle expiry, a five-second timeout, response draining, and shutdown cleanup. Liveness probes perform no HTTP calls; regression coverage confirms they do not share this leak.