Repository navigation
3.x: preserve OVERLOADED during authentication (DRIVER-1121) - #1160
Conversation
ScyllaDB can return OVERLOADED while processing CREDENTIALS or AUTH_RESPONSE. Preserve it as OverloadedException instead of turning it into AuthenticationException, and exclude it from authentication-error metrics. Treat that transient setup failure like a connection failure in control-connection and dynamic pool-creation paths, allowing next-host failover and later pool growth. Cover protocol v1/v4 classification, metrics, initial contact points, and pool retry. Fixes scylladb#1159 Jira: https://scylladb.atlassian.net/browse/DRIVER-1121
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: QUIET Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAuthentication handlers now propagate Suggested reviewers: Priority: ➖ Normal Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Authentication overloads can now reach host recovery without being misclassified as bad credentials. The reviewed paths leave no established material merge risk. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The inspected paths preserve authentication failure controls while treating overload as a recoverable server condition. Failed connections are not published, and pool-growth capacity is released for later attempts. No introduced security concern was identified, but broader security coverage remains incomplete. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Host-up and host-add processing may open a connection to reprepare cached statements after cancelling the current reconnection attempt. The newly preserved OverloadedException bypassed the existing transient connection-error handling and could abort that lifecycle. Treat authentication overload like other connection failures in prepareAllQueries so pool creation and recovery can continue, with regression coverage for cached reprepare. Refs scylladb#1159 Jira: https://scylladb.atlassian.net/browse/DRIVER-1121
nikagra
left a comment
There was a problem hiding this comment.
LGTM. Overload propagation, channel cleanup, control-connection failover, pool-slot release and reprepare all check out. Nits inline. Please remove README.md update
Keep the Scylla-specific fix out of the upstream changelog, and reuse the existing package-local error-response helper in the authentication regression tests. Refs scylladb#1159 Jira: https://scylladb.atlassian.net/browse/DRIVER-1121
ScyllaDB will return native-protocol
OVERLOADEDinstead ofBAD_CREDENTIALSwhen authentication cannot proceed because the server is overloaded. Java driver 3.x currently turns every authentication-phase error intoAuthenticationException, making this transient condition look like invalid credentials.This change:
OVERLOADEDasOverloadedExceptionafter protocol-v1CREDENTIALSand v2+AUTH_RESPONSE;BAD_CREDENTIALSasAuthenticationExceptionand excludes overload from authentication-error metrics;Java driver 4.x is not changed: its existing initializer reserves
AuthenticationExceptionforAUTH_ERROR, while other setup errors close the incomplete channel and remain eligible for node failover and reconnection.Fixes #1159
Jira: https://scylladb.atlassian.net/browse/DRIVER-1121
Compatibility and risk
No public API or wire-format change. Applications may now observe the existing
OverloadedExceptiontype where they previously sawAuthenticationException. Exhausting all initial contact points still returnsNoHostAvailableException, with each overload retained in its per-host error map.Testing
mvn -pl driver-core test: 723 run, 0 failures/errors, 1 skipped.mvn -pl driver-core -Dtest=ConnectionAuthenticationTest test: 6 passed.mvn -pl driver-core -Pshort -Dtest=HostConnectionPoolTest#should_retry_additional_connection_after_authentication_overload -DfailIfNoTests=false -Dclirr.skip=true -Danimal.sniffer.skip=true test: passed.mvn -pl driver-core fmt:format: 561 files checked, 0 noncomplying.git diff --check