honcho/src/deriver
Rajat Ahuja bf494257b8
add read db (#773)
* feat: implement read DB and fix queue stale cleanup

* fix: use read_db in internal methods

* fix: mention read db in the CLAUDE.md

* fix: make TRACING checkout hook autocommit-safe; sample cleanup-gate jitter once

The DB.TRACING checkout hook ran `SELECT set_config(...)` at pool checkout,
before the dialect applies the read engine's AUTOCOMMIT isolation level. That
statement autobegins a transaction, and psycopg then refuses to switch the
connection into AUTOCOMMIT ("can't change 'autocommit' now: connection in
transaction status INTRANS"), so every read_only session 500s under TRACING and
the INTRANS connection leaks back to poison later write checkouts. Run the hook
in autocommit and restore the prior mode so it never leaves an open transaction;
set_config(..., is_local=false) is session-scoped and survives the boundary.
Add a regression test (fails without the fix) covering read_only + TRACING.

Also sample the stale-cleanup gate's jittered interval once per attempt instead
of re-rolling it every poll, so the spacing is a fixed deadline per cycle rather
than a random walk (and is testable at non-zero jitter ratios).

* fix: reset request_context in TRACING checkout-hook test

---------

Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
2026-06-10 13:28:36 -04:00
..
__init__.py refactor: queue manager 2025-09-05 12:47:15 -04:00
__main__.py Connection Exponential Backoff (#758) 2026-06-01 12:57:07 -04:00
consumer.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
deriver.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
enqueue.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
prompts.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
queue_manager.py add read db (#773) 2026-06-10 13:28:36 -04:00