Skip to content

[upstream #16436] upstream PR #16436 follow-up: shutdown and reap never finalize marker-only compaction snapshots #175

Description

@berry-13

Split out of the review of LibreChat-AI#16436 — LibreChat-AI#16436 (comment).

What happens

A disconnected manual compaction persists a marker-only snapshot (unfinished: true, error: false) through the allSubscribersLeft handler. When the owning server then shuts down or the job is reaped, no request error path runs settleExistingRowsBeforeErrorTurn: finalizeOwnedJobsForShutdown only claims and finishes the stream job, and the reap path only aborts and removes its runtime. The Mongo row keeps its live-run shape: a partial summary stays unfailed (labeled as a successful user compaction after restart) and a thinking-only snapshot keeps no compaction identity at all.

Expected

The shutdown and reap lifecycle paths run the same failed-compaction finalizer before retiring the job, so no marker-only snapshot survives its owner.

Why it is out of scope for LibreChat-AI#16436

That PR owns the request-driven settlement paths (Stop, error turn); wiring the manager's shutdown and reap lifecycles into message persistence is a separate surface with its own ordering constraints.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: apireviewctl followups statebugSomething isn't workingreadyreviewctl followups state

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions