Skip to content

test: synchronize two-session receive lock harness#220

Merged
NikolayS merged 1 commit intomainfrom
fix/two-session-lock-harness-sync
May 6, 2026
Merged

test: synchronize two-session receive lock harness#220
NikolayS merged 1 commit intomainfrom
fix/two-session-lock-harness-sync

Conversation

@NikolayS
Copy link
Copy Markdown
Owner

@NikolayS NikolayS commented May 6, 2026

Follow-up to #175.\n\nThe original harness waited for subscription.sub_batch is not null from another session, but that update is uncommitted while session1 holds the transaction, so the poll only succeeds after the lock is already gone.\n\nThis changes synchronization to:\n- give session1 a unique application_name;\n- poll pg_stat_activity until session1 is visibly inside pg_sleep() with the transaction open;\n- only then launch session2.\n\nLocal PG17 check on current main now fails meaningfully:\n\ntext\nFAIL: session2 returned batch 2; expected session1 batch 1\nsession2 receive time: ~3.5s\n\n\nThat is the intended RED behavior until the receive row-lock/idempotency fix lands.

@NikolayS NikolayS merged commit 1257766 into main May 6, 2026
11 checks passed
@NikolayS NikolayS deleted the fix/two-session-lock-harness-sync branch May 6, 2026 22:43
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.

1 participant