kshitijk4poor
db339f0051
fix(state): consolidate gateway SessionDB writers via process-wide shared registry
...
A gateway process opened state.db from ~12 call sites, each minting its
own writer connection, self._lock, close-time WAL checkpoint, and
token-writer thread. With N independent writers on one WAL file, one
connection's close-time checkpoint could race another's growth — the
lost/reordered-page-write signature across 11+ incidents (#90837 ).
Adds hermes_state_registry.py: a process-wide, per-path, refcounted
shared registry owning the writer boundary.
- acquire(path): same resolved path returns the same instance (one
writer connection, one lock, one token-writer thread) for every
long-lived in-process caller (gateway runner, SessionStore, per-agent
lazy recall, cron per-job, mirror, channel_directory, slash_commands,
shutdown_flush, session_search, react_to_message, delegate, mcp_serve,
auto_archive, tui_gateway).
- close() on a shared instance is a NO-OP — the registry owns the
lifecycle, so one caller's close can never tear down a writer other
callers still hold.
- Generation-aware retirement on inode change: a replaced state.db
RETIRES the live generation (never lent again) but keeps it alive for
existing holders; release is object-keyed so holders of the old
generation drain it independently of the new one. The old
generation's own write path still fails with the typed
StateDbReplacedError (existing protection, unchanged).
- Replacement-open failure leaves NO registry entry for the path —
the next acquire retries fresh, never hands out a closed stale object.
- All teardown runs OUTSIDE the registry lock: a final release's WAL
checkpoint can never stall acquisition for every state.db.
- close_shared_session_dbs() at gateway shutdown drains every
generation (live + retired) as the final safety net.
CLI one-shots, recovery flows, and read-only cross-profile opens keep
using SessionDB() directly with their own close() — only long-lived
in-process sites route through the registry.
References #90837 (root-cause tracker stays open: the #10 EOF signature
and the WAL-lifecycle A/B verdict remain under investigation there).
2026-09-01 20:55:35 +05:30
..
2026-08-25 01:48:43 +05:30
2026-08-31 10:09:04 -07:00
2026-08-28 07:51:16 -07:00
2026-07-29 13:10:23 -07:00
2026-08-26 10:10:11 -07:00
2026-08-26 10:10:11 -07:00
2026-08-29 18:34:35 -07:00
2026-08-14 21:54:56 -07:00
2026-08-29 18:34:35 -07:00
2026-08-29 18:34:35 -07:00
2026-08-29 18:34:35 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-09-01 16:27:20 +05:30
2026-07-29 13:10:23 -07:00
2026-08-29 18:34:35 -07:00
2026-07-29 13:10:23 -07:00
2026-08-12 23:47:28 -07:00
2026-08-14 21:27:05 -07:00
2026-08-15 00:34:29 -07:00
2026-08-29 18:34:35 -07:00
2026-08-18 20:34:46 -04:00
2026-08-20 12:29:11 -05:00
2026-08-29 18:34:35 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-23 02:54:30 -07:00
2026-08-31 10:51:19 -07:00
2026-07-29 13:10:23 -07:00
2026-08-31 13:00:24 -07:00
2026-08-31 11:18:53 -07:00
2026-07-04 15:44:50 -07:00
2026-07-29 15:37:24 -07:00
2026-08-13 11:41:59 -07:00
2026-07-15 07:47:18 -07:00
2026-07-29 13:10:23 -07:00
2026-07-01 17:00:30 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-09-01 07:00:38 -07:00
2026-07-29 13:10:23 -07:00
2026-08-03 23:01:03 +05:30
2026-08-24 20:11:18 -07:00
2026-08-13 11:45:27 -07:00
2026-08-02 22:15:20 +05:30
2026-08-11 23:36:47 -05:00
2026-07-29 13:10:23 -07:00
2026-08-31 13:00:24 -07:00
2026-08-02 20:12:50 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-26 10:10:11 -07:00
2026-08-16 10:27:52 -07:00
2026-07-29 13:10:23 -07:00
2026-08-29 11:33:05 +05:30
2026-07-29 13:10:23 -07:00
2026-08-22 19:30:10 -07:00
2026-08-16 01:55:00 -07:00
2026-07-29 13:10:23 -07:00
2026-08-14 21:54:56 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-14 13:56:58 -07:00
2026-07-29 13:10:23 -07:00
2026-07-31 23:16:58 -07:00
2026-08-20 20:20:23 -07:00
2026-08-02 11:52:59 +05:30
2026-08-07 16:57:11 +05:30
2026-07-29 13:10:23 -07:00
2026-06-27 11:43:08 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 01:04:19 -07:00
2026-07-29 13:10:23 -07:00
2026-08-31 14:02:55 -07:00
2026-08-31 13:00:18 -07:00
2026-08-31 13:00:18 -07:00
2026-08-24 11:25:04 -07:00
2026-07-29 15:37:24 -07:00
2026-08-24 21:46:05 -07:00
2026-08-12 12:42:39 +05:30
2026-08-28 04:58:14 -07:00
2026-08-23 19:02:30 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-24 11:25:04 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 03:16:21 -07:00
2026-08-23 18:27:07 -07:00
2026-08-26 21:38:20 -07:00
2026-07-22 08:11:40 -07:00
2026-08-31 12:36:02 -07:00
2026-07-29 13:10:23 -07:00
2026-07-23 08:19:14 -07:00
2026-07-29 13:10:23 -07:00
2026-08-09 22:29:39 +05:30
2026-08-23 18:27:07 -07:00
2026-07-29 13:10:23 -07:00
2026-08-30 19:46:21 -07:00
2026-08-30 09:03:57 -07:00
2026-08-28 12:38:49 +05:30
2026-08-31 14:09:42 +05:30
2026-06-21 11:34:47 -07:00
2026-07-29 13:10:23 -07:00
2026-08-02 22:15:20 +05:30
2026-06-25 12:56:05 -07:00
2026-07-29 15:37:24 -07:00
2026-08-07 13:24:56 +05:30
2026-07-29 13:10:23 -07:00
2026-08-30 19:46:21 -07:00
2026-08-31 09:58:11 -07:00
2026-08-26 07:16:04 -07:00
2026-08-31 14:09:42 +05:30
2026-08-28 02:29:27 +05:30
2026-08-30 19:46:21 -07:00
2026-08-31 13:00:33 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-28 06:32:43 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-23 15:03:29 +05:30
2026-07-31 23:16:58 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-31 10:39:55 -07:00
2026-07-31 23:16:58 -07:00
2026-07-29 13:10:23 -07:00
2026-08-31 20:43:00 -05:00
2026-07-29 13:10:23 -07:00
2026-08-23 18:27:07 -07:00
2026-08-26 07:16:04 -07:00
2026-07-29 13:10:23 -07:00
2026-08-14 01:08:13 -07:00
2026-09-01 14:33:23 +05:30
2026-07-29 13:10:23 -07:00
2026-07-23 19:44:35 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-08 05:44:18 -07:00
2026-07-29 21:30:53 -07:00
2026-08-04 11:00:04 +05:30
2026-08-24 04:14:26 +05:30
2026-08-16 06:31:46 -07:00
2026-08-29 18:34:35 -07:00
2026-08-03 19:08:09 +05:30
2026-08-04 11:35:06 -06:00
2026-08-04 13:12:24 +05:30
2026-07-17 13:08:46 -04:00
2026-08-29 18:34:35 -07:00
2026-08-29 18:34:35 -07:00
2026-08-23 20:01:18 -07:00
2026-08-04 13:20:15 +05:30
2026-08-12 23:47:28 -07:00
2026-08-14 21:54:56 -07:00
2026-07-29 13:10:23 -07:00
2026-08-29 18:34:35 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-22 04:20:48 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-16 22:06:41 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-31 10:08:13 -07:00
2026-08-03 20:43:38 +05:30
2026-08-23 20:01:18 -07:00
2026-08-14 16:37:36 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-31 10:42:39 -07:00
2026-09-01 02:14:35 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-02 21:48:06 -07:00
2026-08-16 22:06:08 -07:00
2026-08-15 01:04:19 -07:00
2026-08-03 21:53:13 +05:30
2026-07-29 13:10:23 -07:00
2026-08-28 03:46:24 -07:00
2026-08-23 18:43:12 -07:00
2026-08-30 20:40:43 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-13 15:24:47 +05:30
2026-08-28 13:05:06 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-28 06:36:22 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-19 14:58:59 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-27 21:07:21 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-29 02:30:44 -07:00
2026-08-31 13:00:33 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-28 12:15:24 -07:00
2026-08-14 02:04:24 +05:30
2026-07-29 13:10:23 -07:00
2026-08-23 18:25:19 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-30 09:03:57 -07:00
2026-08-08 05:09:43 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-29 12:06:48 +05:30
2026-07-29 13:10:23 -07:00
2026-08-23 13:34:32 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-19 22:41:05 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 21:30:53 -07:00
2026-08-13 23:15:25 +05:30
2026-08-24 21:45:30 -07:00
2026-08-13 23:15:25 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-06-19 15:23:41 +08:00
2026-08-15 01:04:19 -07:00
2026-08-20 00:03:50 +05:30
2026-08-17 12:58:51 -07:00
2026-08-17 12:58:51 -07:00
2026-08-07 19:44:35 +05:30
2026-08-14 22:04:16 -07:00
2026-07-29 13:10:23 -07:00
2026-08-01 14:27:12 +05:30
2026-07-01 06:02:33 -07:00
2026-08-03 22:43:15 +05:30
2026-07-23 16:17:27 -07:00
2026-08-13 23:10:16 +05:30
2026-08-14 21:36:41 -07:00
2026-07-29 13:10:23 -07:00
2026-07-23 18:40:09 -07:00
2026-07-29 13:10:23 -07:00
2026-07-23 18:40:09 -07:00
2026-08-13 15:24:47 +05:30
2026-08-13 15:24:47 +05:30
2026-08-19 13:56:11 -05:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-24 03:20:57 -07:00
2026-07-29 15:12:28 -07:00
2026-08-31 12:20:02 -07:00
2026-08-12 14:42:00 -04:00
2026-08-14 03:31:22 +05:30
2026-07-29 13:10:23 -07:00
2026-08-30 05:15:46 -07:00
2026-07-29 13:10:23 -07:00
2026-07-09 21:10:07 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-29 05:02:54 -07:00
2026-07-29 15:37:24 -07:00
2026-09-01 07:00:38 -07:00
2026-07-29 07:47:06 +10:00
2026-08-02 15:01:11 -07:00
2026-08-28 23:38:59 -05:00
2026-08-15 00:33:01 -07:00
2026-08-24 20:25:10 -07:00
2026-08-29 19:14:15 -07:00
2026-08-25 12:59:29 -07:00
2026-07-29 13:10:23 -07:00
2026-08-12 18:41:59 -07:00
2026-08-12 16:25:20 -07:00
2026-07-29 13:10:23 -07:00
2026-08-30 01:20:27 -07:00
2026-07-29 13:10:23 -07:00
2026-08-03 22:55:36 +05:30
2026-08-31 09:57:22 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-31 11:18:53 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 15:37:24 -07:00
2026-08-06 02:22:08 +05:30
2026-08-06 02:22:08 +05:30
2026-08-23 17:47:50 -07:00
2026-08-25 12:59:29 -07:00
2026-08-17 14:06:16 -07:00
2026-08-29 06:37:06 -07:00
2026-08-29 11:33:05 +05:30
2026-08-29 11:33:05 +05:30
2026-08-13 15:24:47 +05:30
2026-08-29 12:23:41 +05:30
2026-07-29 13:10:23 -07:00
2026-08-26 10:10:11 -07:00
2026-07-29 13:10:23 -07:00
2026-08-08 23:14:30 -07:00
2026-07-29 13:10:23 -07:00
2026-07-10 05:41:59 -05:00
2026-08-19 22:56:04 -07:00
2026-08-19 16:04:22 -07:00
2026-08-27 03:24:20 -07:00
2026-08-06 22:02:37 -05:00
2026-09-01 00:25:45 +05:30
2026-08-22 16:47:39 +02:00
2026-08-05 22:40:51 -07:00
2026-08-19 22:11:13 -04:00
2026-08-13 12:23:36 -07:00
2026-08-19 08:52:03 -07:00
2026-08-19 08:52:03 -07:00
2026-08-15 00:33:01 -07:00
2026-08-19 09:14:12 -07:00
2026-08-19 08:52:01 -07:00
2026-08-16 01:55:51 -07:00
2026-08-08 17:42:34 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-07 19:44:35 +05:30
2026-08-23 19:04:37 -07:00
2026-07-21 12:11:31 +05:30
2026-08-19 16:32:17 -07:00
2026-07-29 13:10:23 -07:00
2026-08-20 11:36:54 +05:30
2026-07-29 13:10:23 -07:00
2026-08-23 20:00:30 -07:00
2026-08-21 13:21:46 +10:00
2026-08-07 16:57:11 +05:30
2026-08-16 11:32:02 -07:00
2026-08-02 16:16:36 -07:00
2026-08-23 13:34:32 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-12 19:44:04 -07:00
2026-08-15 23:03:52 -07:00
2026-08-29 08:23:47 -07:00
2026-07-31 07:30:30 -07:00
2026-07-29 13:10:23 -07:00
2026-08-30 01:24:14 -07:00
2026-07-29 13:10:23 -07:00
2026-08-30 04:53:39 -07:00
2026-08-29 20:39:04 -07:00
2026-08-16 06:24:56 -07:00
2026-08-29 02:30:44 -07:00
2026-08-08 00:07:14 +05:30
2026-08-21 13:24:43 +05:30
2026-08-14 14:15:42 -07:00
2026-08-08 15:10:24 +05:30
2026-07-29 13:10:23 -07:00
2026-08-08 14:09:41 -07:00
2026-08-25 02:45:10 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-18 20:34:46 -04:00
2026-09-01 02:14:35 -07:00
2026-08-23 18:25:19 -07:00
2026-07-29 13:10:23 -07:00
2026-08-27 16:13:45 +05:30
2026-07-29 13:10:23 -07:00
2026-08-16 22:07:43 -07:00
2026-07-29 10:14:11 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-07 19:44:35 +05:30
2026-07-29 13:10:23 -07:00
2026-07-30 21:07:36 +05:30
2026-08-08 12:31:19 -07:00
2026-08-29 19:13:00 -07:00
2026-07-28 03:54:16 -05:00
2026-08-29 11:33:05 +05:30
2026-08-31 10:10:25 -07:00
2026-08-24 20:10:44 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 00:33:01 -07:00
2026-08-16 22:10:02 -07:00
2026-07-29 13:10:23 -07:00
2026-08-23 18:24:43 -07:00
2026-07-20 13:04:12 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-09-01 20:55:35 +05:30
2026-07-29 13:10:23 -07:00
2026-08-25 01:34:56 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-31 11:18:53 -07:00
2026-07-29 13:10:23 -07:00
2026-08-29 11:33:05 +05:30
2026-07-29 13:10:23 -07:00
2026-08-16 01:56:18 -07:00
2026-09-01 03:19:59 +05:30
2026-07-29 13:10:23 -07:00
2026-08-28 03:46:24 -07:00
2026-07-29 13:10:23 -07:00
2026-08-20 12:35:20 +05:30
2026-07-29 13:10:23 -07:00
2026-07-16 04:23:12 -07:00
2026-08-28 07:51:31 -07:00
2026-08-24 03:23:07 -07:00
2026-07-24 15:55:08 -07:00
2026-08-16 00:14:58 -07:00
2026-08-03 20:43:38 +05:30
2026-08-12 01:15:25 -07:00
2026-06-30 00:59:29 -05:00
2026-08-29 12:33:44 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 18:55:10 -07:00
2026-08-22 16:07:12 +05:30