One outbox event costs seven to nine write transactions on SQLite

Open
#3,282 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
54/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp, sqlite
Domain
backend, databases

Research direction

Start with OutboxDrainer.cs at the cited lines and OutboxKick.cs:24, then trace how delivery claims, leases, and settlement work with SQLite. The proposal identifies four changes, but does not name tests or explain how maintenance scheduling is structured. Done means the acceptance criterion holds: delivering N events uses O(1) write transactions, excluding handlers' own transactions.

Written by the indexing model from the issue text.

Description

area:events performance type:bug

Problem

On SQLite every ExecuteUpdate/ExecuteDelete takes BEGIN IMMEDIATE. OutboxDrainer (OutboxDrainer.cs:87,115,248,258) runs the exhausted sweep on every loop, renews each row on start, and settles each row on its own, on top of the kick insert and the job claim and settle (OutboxKick.cs:24). Under editing load this multiplies writer-lock waits and the risk of database is locked.

Proposal

Move the exhausted sweep to maintenance, skip the start renewal while the claim lease covers the delivery timeout, settle a batch in one update, and filter the kick query by queue and due time.

Acceptance

  • Delivering a batch of N events takes O(1) write transactions plus the handlers' own

Found in the code review of 17 Nov 2026 (P3).

Dominant language
C#
Stars
569
Forks
107
Avg merge
2h 49m
Merged PRs (30d)
397

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fluentcms/FluentCMS

All issues in fluentcms/FluentCMS

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.