terrymanu commented on issue #37488:
URL:
https://github.com/apache/shardingsphere/issues/37488#issuecomment-3688743718
Issue Understanding
- Issue #37488 only has the title “Connection ID may overflow, which could
lead to duplicates.” The template is empty—no version, project type, or
reproduction info.
Root Cause
- Current implementation
proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/connection/ConnectionIdGenerator.java
uses an int counter that resets to 0 after Integer.MAX_VALUE and then returns
1; the unit test confirms this wrap-around, so it is
intentional. A duplicate can occur only if a single JVM allocates over
2.1B connection IDs while earlier connections are still alive.
Analysis
- MySQL/PostgreSQL/openGauss/Firebird frontends all share this generator.
Duplicates would require an extreme, long-lived process with massive connection
churn. The issue provides no environment or evidence, so we cannot tell if the
wrap-around was actually hit or if
this is just a theoretical concern.
Conclusion
- Current information is insufficient. Please provide:
1. Version and whether you use Proxy or JDBC;
2. Uptime and connection pattern/rate (long-lived vs high-concurrency
short connections);
3. Observed duplicate connection IDs with evidence (two concurrent
connections showing the same ID plus related logs/packet captures);
4. A reproducible script or steps.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]