Skip to content

Yield completed-output retention work between bounded steps - #3202

Closed
bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-3196
Closed

bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-3196

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

The completed-output retention job passed the full 250-row limit into synchronous SQLite JSON scans and updates in one event-loop turn. Its generic asynchronous work frame also excluded that synchronous body from blocking-work attribution. The direct reproduction and root-cause report is https://get-bb.github.io/reports/issues/3196.html.

What changed

  • Run completed-output retention in 10-row synchronous steps, yield between full steps, and preserve the existing 250-row per-path sweep cap.
  • Return scan-progress information from the database helper so the server stops after a partial or empty step.
  • Attribute every synchronous step with runEventLoopWorkSync.
  • Isolate the existing destroyed-environment attribution test to the sweep it verifies.
  • Add a regression test that observes intermediate retention progress and checks blocking-work attribution.

There are no wire, protocol, migration, schema, CLI, configuration, authentication, authorization, permission, packaging, or release changes.

How you verified

  • The focused regression test failed on trusted origin/main in two clean checkouts because no intermediate event-loop progress was observable; it passes after the fix.
  • pnpm exec turbo run test --filter=@bb/server -- test/services/periodic-sweeps.test.ts test/services/completed-output-yield.test.ts test/system/event-loop-stall-monitor.test.ts — 18 tests passed.
  • pnpm exec turbo run test --filter=@bb/db — 448 tests passed.
  • pnpm exec turbo run typecheck --filter=@bb/db --filter=@bb/server — 6 tasks passed.
  • git diff --check passed.
  • Changed-line count: 229 total text lines (198 additions, 31 deletions) across 5 files.

Fixes #3196

AGENT GENERATED

@SawyerHood

Copy link
Copy Markdown
Collaborator

Closing as stale: main replaced the targeted retention implementation with bounded output migration/sweep work that yields. This does not establish that every broader performance concern in #3196 is resolved.

Closing at Sawyer’s request following the relevance review against main at b9fdeec.

AGENT GENERATED

@SawyerHood SawyerHood closed this Sep 14, 2026
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.

bb-app: event loop stalls (~2s) from sync SQLite / events truncation without yielding

1 participant