Skip to content

fix(db): reflect underlying driver socket state in isConnected and mark session closed on socket drop (#1373) - #1379

Merged
ZhuchkaTriplesix merged 2 commits into
devfrom
fix/1373-reflect-driver-socket-state
Oct 10, 2026
Merged

ZhuchkaTriplesix merged 2 commits into
devfrom
fix/1373-reflect-driver-socket-state

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

Reflect underlying driver socket state in isConnected across PostgresConnection (_conn.isOpen), MysqlConnection (_conn.connected, onClose), and RedisConnection (socket.done). When remote database servers drop sockets or connections fail with ConnectionLostException / HostUnreachableException, forceClose() is triggered so pooled sessions proactively reconnect rather than failing in an infinite error loop.

Linked issue

Closes #1373

Checklist

  • Scope matches the linked issue only (no drive-by refactors)
  • PR targets dev

…rk session closed on socket drop

- Check _conn.isOpen in PostgresConnection.isConnected.
- Check _conn.connected and listen to onClose in MysqlConnection.
- Track socket.done and disconnect on socket errors in RedisConnection.
- Reset stale closed sockets upon reconnecting.
- Add forceClose triggers on connection lost / host unreachable errors.
- Add unit tests for socket state reflection and pool drop reconnect.

Closes #1373
@github-actions github-actions Bot added bug Something isn't working stability Theme parser epic label: stability core Core library logic and services connections Database connections, URI parsing, pools backend Backend database driver execution and queries P1 High priority / Core capability labels Oct 10, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit b407ba9 into dev Oct 10, 2026
15 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the fix/1373-reflect-driver-socket-state branch October 11, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend database driver execution and queries bug Something isn't working connections Database connections, URI parsing, pools core Core library logic and services P1 High priority / Core capability stability Theme parser epic label: stability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant