Skip to content

fix(common): gracefully drain leader pushes on shutdown - #1440

Draft
schickling wants to merge 3 commits into
mainfrom
schickling/revisit/1405
Draft

fix(common): gracefully drain leader pushes on shutdown#1440
schickling wants to merge 3 commits into
mainfrom
schickling/revisit/1405

Conversation

@schickling

Copy link
Copy Markdown
Collaborator

Problem

Orderly Store.shutdown() can interrupt an in-flight client-to-leader push and abandon additional queued events. PR #1405 fixed that loss, but its handling of scope-finalizer order, rebase ownership, rejection recovery, and terminal failures grew too complex for this core sync path and was auto-merged before explicit human sign-off.

PR #1439 reverts that implementation while retaining its stronger tests as skipped specifications. GitHub cannot literally reopen a merged PR, so this stacked draft recreates #1405 as the active design and review surface.

Goal

Keep the original problem, implementation, review history, and test discoveries available while we replace the implementation quickly with a smaller explicit pre-scope shutdown boundary tracked by #1437.

This draft is not proposed for merge in its current form.

Decisions

Verification

Complexity

The current implementation adds 108 net production lines to ClientSessionSyncProcessor and introduces rejection revision/prefix tracking, drain-failure side channels, finalizer-order coupling, and uninterruptible rebase transitions. Reducing that state and interaction budget is the purpose of reopening the design.

Concerns

Friction & bottlenecks

  • A merged GitHub PR cannot be reopened, requiring this stacked recreation.
  • No product-performance bottleneck was introduced or measured.

Follow-ups

References

@schickling schickling added bug Something isn't working syncing Sync engine and protocol · Set: manual testing Testing · Set: manual labels Jul 18, 2026
@schickling
schickling requested a review from IGassmann July 18, 2026 08:58
Base automatically changed from schickling/revert/1405 to main July 18, 2026 09:04
@github-actions

Copy link
Copy Markdown
Contributor

PR preview

Subject Status Report Details Updated
LiveStore docs preview success Docs preview deployed (livestore-docs-dev) PR aliases: pr-1440-dd19312, pr-1440 2026-07-18 09:20 UTC
web-linearlite success web-linearlite deployed (preview) Worker: example-web-linearlite-preview.livestore.workers.dev 2026-07-18 09:02 UTC
web-todomvc success web-todomvc deployed (preview) Worker: example-web-todomvc-preview.livestore.workers.dev 2026-07-18 09:02 UTC
web-todomvc-script success web-todomvc-script deployed (preview) Worker: example-web-todomvc-script-preview.livestore.workers.dev 2026-07-18 09:02 UTC
web-todomvc-sync-cf success web-todomvc-sync-cf deployed (preview) Worker: example-web-todomvc-sync-cf-preview.livestore.workers.dev 2026-07-18 09:02 UTC
Report history

PR 1440 · 2026-07-18 09:26 UTC

Subject Status Report Details Updated
LiveStore docs preview success Docs preview deployed (livestore-docs-dev) PR aliases: pr-1440-dd19312, pr-1440 2026-07-18 09:20 UTC
web-linearlite success web-linearlite deployed (preview) Worker: example-web-linearlite-preview.livestore.workers.dev 2026-07-18 09:02 UTC
web-todomvc success web-todomvc deployed (preview) Worker: example-web-todomvc-preview.livestore.workers.dev 2026-07-18 09:02 UTC
web-todomvc-script success web-todomvc-script deployed (preview) Worker: example-web-todomvc-script-preview.livestore.workers.dev 2026-07-18 09:02 UTC
web-todomvc-sync-cf success web-todomvc-sync-cf deployed (preview) Worker: example-web-todomvc-sync-cf-preview.livestore.workers.dev 2026-07-18 09:02 UTC

@schickling-assistant schickling-assistant added type:bug Something broken or a regression · Set: manual and removed bug Something isn't working labels Jul 19, 2026

@IGassmann IGassmann left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR contains no changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

syncing Sync engine and protocol · Set: manual testing Testing · Set: manual type:bug Something broken or a regression · Set: manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants