Repository navigation
A blind scan of the pre-fix token_scoping.py flagged the #1885 connection leak #7315
Tomosu-AI
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
We used the #1885 leak as a test case for our reliability scanner (disclosure, we build Tomosu). We checked out cf5adcd from before the #1886 fix and gave the scanner only mcpgateway/middleware/token_scoping.py. We didn’t give it the issue, the load test or the patch. Before running it, we wrote down the pass condition: “Identify unsafe database-session cleanup where an operation before close() can fail.”
It flagged “Unsafe database-session lifecycle” at High, noting that an operation before close can fail and leave the connection unreleased. That’s the same failure the 3,000-user load test turned up.
One place we’d like your view. #1886 nests the commit in its own try so close() always runs. Our scan suggested dropping the commit from that cleanup completely, since the path looked read-only to us. We didn’t load test that, so it may well be wrong. Does that path ever need the commit?
Write-up with the method: tomosu.ai/case-studies/contextforge-connection-leak.html
All reactions