fix: reconnect when CAS released under KEEP_CONNECTION=AUTO - #16
Merged
yeongseon merged 2 commits intoJul 26, 2026
Conversation
…cubrid-lab#15) 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 EPIPE / ECONNRESET. Port the same reconnection pattern used by the official JDBC driver (UClientSideConnection.checkReconnect): - Add checkReconnect() that inspects CAS_INFO status before each request - Call it from sendAndRecv() so reconnection is transparent to callers - Add no-op socket error handler to prevent uncaught EPIPE crashes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
Member
Author
|
I just reproduced the EPIPE bug on the current For reference, the same pattern was already fixed and merged in pycubrid (cubrid-lab/pycubrid#24), and I verified it works correctly there — both basic query+close and DDL scenarios pass without errors. This PR applies the same reconnection approach. Would be great to get this merged so #15 can be closed. |
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)checkReconnect()fromsendAndRecv()so reconnection is invisible to callersRoot 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 causeEPIPE/ECONNRESET.Approach
Ported the same reconnection pattern used by the official CUBRID JDBC driver (
UClientSideConnection.checkReconnect()). The Python driver (pycubrid) was fixed with the same pattern in cubrid-lab/pycubrid#24.Test plan
01_connect— basic connection works02_crud— DDL → commit → DML sequence (the failing scenario) now passes03_transactions— commit/rollback cycles workCloses #15
🤖 Generated with Claude Code