[BUG] TcpBootstrapServer.shutdown never disposes the upstream ConnectionProvider (connection-pool leak)
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 85
Description
- severity: Medium
- files: `shenyu-protocol/shenyu-protocol-tcp/src/main/java/org/apache/shenyu/protocol/tcp/TcpBootstrapServer.java:128-131`; `connection/ConnectionContext.java:46-59`
- description: `ConnectionContext.init` builds a pooled `ConnectionProvider` and stores it in `connectionProvider`. `TcpBootstrapServer.shutdown()` disposes `server` and `loopResources` but never disposes `connectionContext`'s `ConnectionProvider`.
- impact: Upstream connection pool leaks on shutdown; pooled channels to backends are not released.
- suggested_fix: Expose a `dispose()` on `ConnectionContext` and call it in `shutdown()`.
- confidence: High
- related_existing: none — #5047 is the TCP plugin event-loop leak; this is the protocol module's upstream pool.
---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._
Contributor guide
No contributing guide indexed for this repository
Research direction
Read TcpBootstrapServer.java around lines 128-131 and ConnectionContext.java around lines 46-59, then trace how the pooled ConnectionProvider is created and owned. Verify the shutdown lifecycle and ensure the connection context's provider is disposed along with the server and loop resources. Done means upstream pooled channels are released when TcpBootstrapServer.shutdown() completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100