Skip to content

Send SQLite errors to DO sentry#6563

Merged
danlapid merged 1 commit into
mainfrom
dlapid/sendSqliteErrorsToDOSentry
Apr 14, 2026
Merged

Send SQLite errors to DO sentry#6563
danlapid merged 1 commit into
mainfrom
dlapid/sendSqliteErrorsToDOSentry

Conversation

@danlapid

Copy link
Copy Markdown
Collaborator

No description provided.

@danlapid danlapid requested review from a team as code owners April 11, 2026 13:15
@danlapid danlapid requested a review from joshthoward April 11, 2026 13:15
@danlapid danlapid force-pushed the dlapid/sendSqliteErrorsToDOSentry branch from a161b20 to 215ab85 Compare April 11, 2026 13:16

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm Bonk, and I've done a quick review of your PR.

This adds a SENTRY_DO prefix to the SQLITE_REQUIRE macro's KJ_FAIL_REQUIRE message to route SQLite errors to DO Sentry.

Issues (by severity):

  1. [MEDIUM] SENTRY_DO tag applied too broadly. The SQLITE_REQUIRE macro is defined in util/sqlite.c++, which is a general-purpose SQLite wrapper. It is used not only for Durable Object storage (ActorSqlite, SqlStorage, SqliteKv) but also by AlarmScheduler (server-level alarm persistence in server/alarm-scheduler.c++) and generic SqliteDatabase operations with the TRUSTED regulator. Tagging all SQLITE_REQUIRE failures as SENTRY_DO would misattribute non-DO SQLite errors. In practice this may be acceptable if the AlarmScheduler never hits these paths in production, but it's worth noting.

  2. [LOW] Potential conflict with NOSENTRY on SQLITE_BUSY. Line 290 passes kj::str("NOSENTRY ", dbErrorMessage(error, db)) as the errorMessage to SQLITE_REQUIRE. After this change, KJ_FAIL_REQUIRE produces a description of "SENTRY_DO SQLite failed" with "NOSENTRY ..." in the detail arguments. Whether the SENTRY_DO in the description overrides the NOSENTRY in the detail depends on how the internal log pipeline parses these -- worth verifying that SQLITE_BUSY errors don't start showing up in DO Sentry unexpectedly.


This review was generated by an AI assistant and may contain inaccuracies.

@ask-bonk

ask-bonk Bot commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

I've posted my review on PR #6563. Here's a summary of the findings:

What the PR does: Adds a SENTRY_DO prefix to the SQLITE_REQUIRE macro's error message to route SQLite failures to Durable Object Sentry.

Issues found:

  1. [MEDIUM] Tag applied too broadly -- SQLITE_REQUIRE is in the general-purpose util/sqlite.c++ wrapper, which is used by both DO storage and non-DO infrastructure like AlarmScheduler. All SQLite errors would be misattributed as DO errors.

  2. [LOW] Potential NOSENTRY/SENTRY_DO conflict -- The SQLITE_BUSY path (line 290) already prepends NOSENTRY to the error message detail, but now the description prefix would say SENTRY_DO. Whether these conflict depends on internal log pipeline behavior.

Neither issue has a concrete code fix to suggest (they're design/architecture questions requiring author input), so no suggestion comments were posted.

github run

@danlapid danlapid merged commit 271477b into main Apr 14, 2026
26 of 27 checks passed
@danlapid danlapid deleted the dlapid/sendSqliteErrorsToDOSentry branch April 14, 2026 10:33
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.

2 participants