Skip to content

fix(observe): take the write lock first when recording browser errors - #212

Merged
ryuzdev merged 1 commit into
mainfrom
fix/browser-error-begin-immediate
Dec 1, 2026
Merged

ryuzdev merged 1 commit into
mainfrom
fix/browser-error-begin-immediate

Conversation

@ryuzdev

@ryuzdev ryuzdev commented Dec 1, 2026

Copy link
Copy Markdown
Member

record_browser_error reads before it writes inside a deferred transaction. Under a concurrent commit its snapshot goes stale and the first write fails with SQLITE_BUSY_SNAPSHOT (517), which busy_timeout does not retry: browser-error beacons can drop under load, and mcp::tests::app_errors_filters_by_source failed CI twice (runs 46507051761, 46596224592) with database is locked (code 517). BEGIN IMMEDIATE takes the write lock up front (waits under busy_timeout) and makes the cap check atomic, like apps::create / auth::limits. Checks: fmt, clippy, observe:: 72 pass, mcp::tests::app_errors* 25x locally with no failure.

- record_browser_error read (known fingerprint, cap count) inside a deferred transaction, then wrote; a concurrent commit staled its snapshot and the write failed with SQLITE_BUSY_SNAPSHOT (517), which busy_timeout never retries. Beacons could drop under load, and mcp::tests::app_errors_filters_by_source flaked in CI twice.
- BEGIN IMMEDIATE waits for the lock instead and keeps the browser-issue cap check atomic (same pattern as apps::create and auth::limits).
@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6486042c-79e4-4675-9b5b-5468d50e0976
Commits

Reviewing files that changed from the base of the PR and between 5ca085e and f4b6c94.

Files selected for processing: 1

  • crates/outer/src/observe/logs.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ryuzdev
ryuzdev merged commit 066eb14 into main Dec 1, 2026
5 checks passed
@ryuzdev
ryuzdev deleted the fix/browser-error-begin-immediate branch December 1, 2026 07:22
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