{{ message }}
Repository navigation
Conversation
Chaho12
force-pushed
the
session-limiter-leak
branch
from
September 22, 2026 09:13
e1dbf13 to
ebbc2c9
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Author
There was a problem hiding this comment.
🟢 Approval recommended
The focused lifecycle fix correctly avoids double-decrementing and is covered by a regression test.
0 open findings
What changed in this PR
Fixes #7759 by releasing connection-limit capacity when interactive session construction fails before registration.
Changes:
- Decrements the session limiter on constructor failure.
- Adds a regression test covering repeated restricted-configuration failures.
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
cxzl25
approved these changes
Oct 10, 2026
wForget
approved these changes
Oct 15, 2026
This branch has not been deployed
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.

Why are the changes needed?
KyuubiSessionManager.openSessiontakes a count from the session limiter before the session isopened, and
closeSessionis the only place that gives one back.SessionManager.openSessioncallscreateSessionoutside thetrywhosecatchcallscloseSession, andAbstractSession.normalizedConfis aval, so a session whose conf failsvalidation dies in the constructor and is never registered in
handleToSession.closeSessionnever runs for it, and the count is kept for good.
Once as many opens have failed as
kyuubi.server.limit.connections.per.userallows, every furtheropen from that user is rejected by the limiter although the user holds no session, until the
server restarts.
kyuubi.server.limit.connections.per.ipaddressleaks the same way.Ordinary client configuration reaches this on a server that follows the documented
kyuubi.session.conf.restrict.listguidance:spark.sql.extensionsis in the example restrictlist in the session configuration docs,
and a client that keeps sending it locks its own account out. We hit this in production - three
server nodes each rejected 20 opens for the restricted key, after which every open from that user
failed with the connection-limit message while
kyuubi_connection_openedstayed 0, and a rollingrestart was the only way to recover.
Affects master and 1.11.1. Batch sessions are not affected:
openBatchSessiontakes its countafter the session is built and inside the
trythat closes it.close #7759
How was this patch tested?
Added
KyuubiSessionManagerLimiterSuite, which setskyuubi.server.limit.connections.per.user=2and a restrict list, then opens
limit + 2sessions carrying the restricted key and asserts everyattempt is still rejected by the restrict list rather than by the limiter.
Passes with the change; with the change reverted it fails on the third attempt with
"Connection limit per user reached (user: user limit: 2)" did not contain "spark.sql.extensions is a restrict key", which is the production symptom.Was this patch assisted by generative AI tooling?
Assisted-by: Claude Opus 5