Skip to content

Journal: streams learn of changes from the shared poll alone, not database notifications - #114

Merged
PALBIBEK merged 1 commit into
mainfrom
journal-poll
Nov 4, 2026
Merged

PALBIBEK merged 1 commit into
mainfrom
journal-poll

Conversation

@PALBIBEK

@PALBIBEK PALBIBEK commented Nov 4, 2026

Copy link
Copy Markdown
Owner

#105 sent pg_notify with every journal write and partial reply. A transaction that
sends one takes a lock on the whole Postgres server as it commits, so every commit on
the server waited its turn (16 writers: 348 appends/s with notifications, 394
without; worse as writers grow), and behind a pooler in transaction mode the
listening connection would silently hear nothing. Writes no longer notify, and the
watch has no listening connection: its shared poll runs every 150 ms (one small
query per process, whatever the number of streams), a starting stream is told at
once, and a session's end is seen within a round instead of within 2 s. The journal
package's docstring now says what each module is.

Journal gaps, PR 3 of 6.

Tests

  • New tests pass on SQLite and Postgres (SUPERVISOR_TEST_PG_URL); ruff and mypy are clean.
  • CI is green on the stack's tip (journal-blob-refs): lint and types, tests, backend, frontend, e2e, compose smoke, journeys.

Generated by Claude Code

…abase notifications

#105 sent pg_notify with every journal write and partial reply. A transaction that
sends one takes a lock on the whole Postgres server as it commits, so every commit on
the server waited its turn (16 writers: 348 appends/s with notifications, 394
without; worse as writers grow), and behind a pooler in transaction mode the
listening connection would silently hear nothing. Writes no longer notify, and the
watch has no listening connection: its shared poll runs every 150 ms (one small
query per process, whatever the number of streams), a starting stream is told at
once, and a session's end is seen within a round instead of within 2 s. The journal
package's docstring now says what each module is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge2HHQ32aPUxZf3EnfAfpt
@PALBIBEK
PALBIBEK merged commit 1bd7fdb into main Nov 4, 2026
0 of 7 checks passed
PALBIBEK pushed a commit that referenced this pull request Nov 4, 2026
…ion ended

The badge shows Ended when the event stream ends, but the composer waited for the
status fetched after it: for a moment a person could type into an ended session, and
the chat journey's check right after End caught it (since #114 the stream learns of
the end within 150 ms, often before End's own response lands). The composer now
blocks on the stream's end too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge2HHQ32aPUxZf3EnfAfpt
PALBIBEK added a commit that referenced this pull request Nov 4, 2026
…ion ended (#123)

The badge shows Ended when the event stream ends, but the composer waited for the
status fetched after it: for a moment a person could type into an ended session, and
the chat journey's check right after End caught it (since #114 the stream learns of
the end within 150 ms, often before End's own response lands). The composer now
blocks on the stream's end too.


Claude-Session: https://claude.ai/code/session_01Ge2HHQ32aPUxZf3EnfAfpt

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants