fix: reconnect when CAS released under KEEP_CONNECTION=AUTO - #12
Merged
yeongseon merged 2 commits intoJul 26, 2026
Conversation
The CUBRID broker may release the CAS process after a transaction commit when KEEP_CONNECTION=AUTO (the default). This sets CAS_INFO[0] to INACTIVE. Subsequent requests on the dead socket cause EOF / broken pipe. Port the same reconnection pattern used by the official JDBC driver (UClientSideConnection.checkReconnect): - Add checkReconnect() that inspects CAS_INFO status before each request - Update CAS_INFO from every response in sendAndRecv() - Return driver.ErrBadConn on socket errors so database/sql retries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
paikend
force-pushed
the
fix/cas-reconnect-on-inactive
branch
from
March 26, 2026 12:32
9b51955 to
21e023c
Compare
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.
Summary
checkReconnect()that inspectsCAS_INFO[0]status before each request and transparently reconnects when the broker has released the CAS process (KEEP_CONNECTION=AUTO, the default)CAS_INFOfrom every response insendAndRecv()(was missing)driver.ErrBadConnon socket errors sodatabase/sqlcan retry with a fresh connectionRoot Cause
The CUBRID broker may release the CAS process after a transaction commit when
KEEP_CONNECTION=AUTO. This setsCAS_INFO[0]toINACTIVE(0). Subsequent requests on the dead socket causeEOF/ broken pipe.Approach
Ported the same reconnection pattern used by the official CUBRID JDBC driver (
UClientSideConnection.checkReconnect()). The same fix was applied to:Test plan
autocommit=true) — failed before fix, passes afterautocommit=false) — passesgo build ./...— no compilation errors🤖 Generated with Claude Code