Calendar account creation maps transient Index errors to HTTP 500 #214

Closed
opened 2026-09-26 21:48:28 +00:00 by kayg · 2 comments
Owner

Finding from the post-merge real-server adversarial pass on job/robustness (head 368c2419). The 20-request POST /api/v1/calendar/accounts duplicate-account storm returned 8 expected conflicts, 11 retryable busy responses, and one HTTP 500 with {"error":{"code":"internal","message":"Calendar operation failed"}}.

The root cause is in crates/plugins/calendar/src/routes.rs::create_account: store_account maps every error other than a unique-constraint conflict to ApiFailure::internal(). This bypasses the existing ApiFailure::database_failure mapper, which returns 503 with Retry-After: 1 for SQLite BUSY/LOCKED and pool timeouts.

Please add a regression for a transient error during account storage and route that error through the existing database mapper. Keep unique conflicts as 409. The pass ran on a shared, loaded host; the 500 was distinct from the expected transient 503 responses.

Finding from the post-merge real-server adversarial pass on `job/robustness` (head `368c2419`). The 20-request `POST /api/v1/calendar/accounts` duplicate-account storm returned 8 expected conflicts, 11 retryable busy responses, and one HTTP 500 with `{"error":{"code":"internal","message":"Calendar operation failed"}}`. The root cause is in `crates/plugins/calendar/src/routes.rs::create_account`: `store_account` maps every error other than a unique-constraint conflict to `ApiFailure::internal()`. This bypasses the existing `ApiFailure::database_failure` mapper, which returns 503 with `Retry-After: 1` for SQLite BUSY/LOCKED and pool timeouts. Please add a regression for a transient error during account storage and route that error through the existing database mapper. Keep unique conflicts as 409. The pass ran on a shared, loaded host; the 500 was distinct from the expected transient 503 responses.
Author
Owner

Reproduced in the latest post-merge real-server adversarial round on the shared host. The 20-request duplicate-account storm returned 16 expected 409 conflicts and 4 unexpected responses: one HTTP 500 {"error":{"code":"internal","message":"Calendar operation failed"}} and three retryable Authentication database busy 503s. Other Calendar writes completed, with SLOW latency reports. This is consistent with the issue's transient Index-to-500 report; no new root-cause claim from this run.

Reproduced in the latest post-merge real-server adversarial round on the shared host. The 20-request duplicate-account storm returned 16 expected 409 conflicts and 4 unexpected responses: one HTTP 500 `{"error":{"code":"internal","message":"Calendar operation failed"}}` and three retryable Authentication database busy 503s. Other Calendar writes completed, with SLOW latency reports. This is consistent with the issue's transient Index-to-500 report; no new root-cause claim from this run.
Author
Owner

Fixed Calendar account creation so unique account conflicts remain 409, while transient SQLite/Index write failures use the retryable database response. Regression test creates an exclusive SQLite lock and verifies 503 with Retry-After: 1. Focused command passed: cargo test -p calternal-plugin-calendar creating_an_account_maps_a_busy_index_write_to_retryable_503 (1 passed; 0 failed).

Fixed Calendar account creation so unique account conflicts remain 409, while transient SQLite/Index write failures use the retryable database response. Regression test creates an exclusive SQLite lock and verifies 503 with Retry-After: 1. Focused command passed: cargo test -p calternal-plugin-calendar creating_an_account_maps_a_busy_index_write_to_retryable_503 (1 passed; 0 failed).
kayg closed this issue 2026-09-29 08:29:18 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#214
No description provided.