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

kobotoolbox / kpi / 37745681293
83%
master: 76%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 08 Oct 2026 07:53AM UTC
Jobs 10
Files 914
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

08 Oct 2026 07:47AM UTC coverage: 82.98%. Remained the same
37745681293

push

github

web-flow
fix(openRosa): lock catch-all counters in date order DEV-2513 (#7674)

### đŸ“Ŗ Summary

Permanently deleting several projects of the same account at the same
time no longer fails with a database deadlock.

### 📖 Description

When several projects of the same account were permanently deleted at
the same time, for example after emptying the trash, some of those
deletions could fail and had to be retried later. They now go through
without getting in each other's way.

### 💭 Notes

- Cause: deleting an `XForm` folds its monthly and daily counters into
the owner's catch-all rows (`xform = NULL`) in
`update_catch_all_counter_on_delete`. The loops had no `ORDER BY`, so
two deletions of the same owner could lock the same months in opposite
orders. Production logs show the deadlocks in exactly that function, on
`logger_monthlyxformsubmissioncounter`. Nothing else writes catch-all
rows, so the other side is always another deletion of the same owner.
- Fix: `order_by('year', 'month')` and `order_by('date')`. Every
deletion now takes these rows in the same order, so the later one waits
instead of deadlocking. The daily loop has the same shape and runs right
after in the same transaction, so it gets the same fix.
- Tests: `TestCatchAllCounterLockOrder` races two real transactions
(`TransactionTestCase`, two threads, a barrier) and forces a sequential
scan, so the unordered query returns rows in insertion order. Without
the fix it fails with the same `deadlock detected ...
logger_monthlyxformsubmissioncounter` as production.
- Second attempt at DEV-2513, after #7553 (suspending the owner's
submissions) was reverted in #7666.
- Out of scope, seen once each in the logs: a deadlock on the daily
counter during `/submission`, and one on `kpi_asset` when two bulk "move
to trash" requests overlap. Also left alone: `update_storage_counters`
locks `UserProfile` before `XForm`, the opposite of the other counter
helpers (no deadlock observed).

### 👀 Preview steps

1. â„šī¸ backen... (continued)

10303 of 13642 branches covered (75.52%)

32958 of 39718 relevant lines covered (82.98%)

5.5 hits per line

Jobs
ID Job ID Ran Files Coverage
1 37745681293.1 08 Oct 2026 07:53AM UTC 909
43.71
2 37745681293.2 08 Oct 2026 07:53AM UTC 909
52.55
3 37745681293.3 08 Oct 2026 07:53AM UTC 909
49.82
4 37745681293.4 08 Oct 2026 07:54AM UTC 911
53.79
5 37745681293.5 08 Oct 2026 07:54AM UTC 911
44.99
6 37745681293.6 08 Oct 2026 07:55AM UTC 911
51.08
7 37745681293.7 08 Oct 2026 07:56AM UTC 912
67.64
8 37745681293.8 08 Oct 2026 07:57AM UTC 909
58.47
9 37745681293.9 08 Oct 2026 07:58AM UTC 911
59.54
10 37745681293.10 08 Oct 2026 07:59AM UTC 914
69.91
Source Files on build 37745681293
  • Tree
  • List 914
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 5cd90971 on github
  • Prev Build on release/2.026.37 (#37471474843)
  • Next Build on release/2.026.37 (#37768324112)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc