Skip to content

feat(dbapi): log bounded session diagnostics after connection loss - #75

Draft
rbavery wants to merge 6 commits into
wherobots:mainfrom
rbavery:codex/wbc-1051-session-diagnostics
Draft

rbavery wants to merge 6 commits into
wherobots:mainfrom
rbavery:codex/wbc-1051-session-diagnostics

Conversation

@rbavery

@rbavery rbavery commented Sep 21, 2026

Copy link
Copy Markdown
Member

What/Why

Follow-up for WBC-1051: after a SQL connection is lost, report the backend's observed session status and recorded first failure without delaying cursor errors or shutdown.

Depends on PR #74; merge that first. This draft targets upstream main, so its current diff includes the prerequisite commits. The diagnostics-only change is commit 4576820. After #74 merges, rebase this branch onto upstream main if needed to remove the prerequisite commits from the diff. Deploy the companion session-status backend changes before enabling/releasing this follow-up.

How

Deliver cursor failures first, then schedule a best-effort diagnostic log correlated by session ID. Diagnostic details do not modify already-delivered exceptions. Explicit close and direct connections without a status URL do not trigger lookups.

Share in-flight/recent requests by exact URL and a digest of the credential/header context. Limit each process to four daemon workers and 128 registry entries, retain completed attempts for 30 seconds, and add up to 500ms of worker-side jitter. No retries or waiting on the caller; stalled requests retain their worker slot and further optional requests are skipped at capacity.

Use a one-second HTTP socket timeout, disable redirects, stream at most 64KiB, and bound status and failure-message fields to 128 and 4096 characters. Log lookup and thread-start failures at DEBUG without request credentials or arbitrary exception text. Per-process sharing doesn't deduplicate across processes.


Co-authored with Codex.

@rbavery
rbavery force-pushed the codex/wbc-1051-session-diagnostics branch from 0e2ec7f to 4576820 Compare September 21, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant