• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Logflare / logflare / 98fd8073677eb25668d77c26241056ce5c355eae
82%

Build:
DEFAULT BRANCH: main
Ran 23 Jun 2026 11:46AM UTC
Jobs 1
Files 487
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Jun 2026 11:32AM UTC coverage: 81.599% (+0.03%) from 81.567%
98fd8073677eb25668d77c26241056ce5c355eae

push

github

web-flow
refactor(ingest queue): timestamp-based stale :processing recovery (#3626)

* refactor(ingest queue): timestamp-based stale :processing recovery

Replace the snapshot/intersection stale-detection in QueueJanitor with a
per-row monotonic claim timestamp. Each queue row gains a sixth field,
claimed_at, set to System.monotonic_time(:millisecond) when a row is claimed
into :processing and reset to 0 on every transition back out. The janitor now
selects :processing rows whose claimed_at is older than a fixed staleness age
instead of building and diffing MapSets of in-flight IDs each cycle.

Stale cleanup is treated as crash recovery rather than normal queue
maintenance: the cadence is slowed to 60s, rows are considered stale after
120s, and each pass is bounded to 1000 rows per queue (logging when the cap is
hit). The retry-then-drop ladder and the select_replace CAS guard are
unchanged.

The claim path reads the clock once per take_pending_ids batch (not per
event) and stamps every row in the batch with the same value. No separate
processing_count is maintained; the bounded select runs each pass.

Status is pinned to :processing in the stale match head, so pending/ingested
rows (claimed_at == 0) are never selected regardless of the monotonic clock's
sign — avoiding a sentinel guard that would misbehave with negative monotonic
time.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(queue janitor): CAS-protect the stale drop path

The drop branch of act_on_stale_event matched any :processing row with the
target id and ignored select_delete's return, so it reported :drop even when
nothing was deleted (inflating the dropped data-loss metric) and could, in the
narrow lookup->delete window, delete a row that had been acked and re-claimed
under the same id.

Pin the exact row observed by the lookup as the CAS match in both the drop and
reset branches (which also guards claimed_at, so a freshly re-claimed row no
longer matches) and gate... (continued)

39 of 39 new or added lines in 3 files covered. (100.0%)

1 existing line in 1 file now uncovered.

13414 of 16439 relevant lines covered (81.6%)

5167.36 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
88.24
1.49% lib/logflare/backends/ingest_event_queue/queue_janitor.ex
Jobs
ID Job ID Ran Files Coverage
1 98fd8073677eb25668d77c26241056ce5c355eae.1 23 Jun 2026 11:46AM UTC 487
81.6
GitHub Action Run
Source Files on build 98fd8073677eb25668d77c26241056ce5c355eae
  • Tree
  • List 487
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 98fd8073 on github
  • Prev Build on main (#26F90FBB...)
  • Next Build on main (#E38C122A...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc