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

cybertec-postgresql / pg_timetable / 39578520812
88%

Build:
DEFAULT BRANCH: master
Ran 21 Oct 2026 09:39AM UTC
Jobs 3
Files 35
Run time 1min
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

21 Oct 2026 09:38AM UTC coverage: 88.132% (+0.2%) from 87.892%
39578520812

push

github

web-flow
[-] fix `active_chain` row leak when a chain fails before its tasks run (#862)

* [-] fix `active_chain` row leak when chain cannot start or load tasks

`executeChain()` returned early on `StartTransaction()` and
`GetChainElements()` errors without calling `RemoveChainRunStatus()`, so the
row inserted by the worker stayed in `timetable.active_chain`. Once the
leaked rows reached `max_instances` the chain was never started again.

Remove the run status on both paths using a context detached from
cancellation, as the task failure path already does.

* [-] remove `active_chain` row in the worker so no `executeChain` exit can leak it

Both workers now call `removeChainRunStatus` right after `executeChain`
returns, pairing the delete with the insert in one place. Cleanup runs on
a detached context bounded by `log.DetachedTimeout` so a cancelled
scheduler context cannot skip it and a dead database cannot block a
worker forever.

Chains that fail before any task runs now count as failed: span status,
`RecordChainFailed` and the `on_error` handler fire on every failure path.
`StartTransaction` rolls back its own transaction when the vxid lookup
fails instead of handing a live `tx` back with an error.

* [-] start the cleanup timeout when cleanup starts, not when the chain starts

`executeChain` created its detached cleanup context before the chain's
transaction began, so `DetachedTimeout` was counted from the start of the
chain. Any chain running longer than 30s committed on an expired context:
pgx never sent `COMMIT`, the chain's transaction was rolled back, and the
chain was still logged as successful. Rollback, `on_error` and
self-destruct after 30s hit the same expired context.

Each exit path now creates its own detached context when its cleanup
starts. `DetachedTimeout` is a variable so the new test can shorten it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [*] note why `DetachedTimeout` is a var

* [-] fix `RemoveChainRunStatus` droppi... (continued)

39 of 41 new or added lines in 5 files covered. (95.12%)

6 existing lines in 2 files now uncovered.

2265 of 2570 relevant lines covered (88.13%)

0.9 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
96.77
-3.23% internal/log/log.go

Coverage Regressions

Lines Coverage ∆ File
5
73.46
-1.42% cmd/pg_timetable/service_windows.go
1
82.22
3.33% internal/pgengine/log_hook.go
Jobs
ID Job ID Ran Files Coverage
1 sql - 39578520812.1 21 Oct 2026 09:39AM UTC 4
95.28
GitHub Action Run
2 linux - 39578520812.2 21 Oct 2026 09:42AM UTC 29
89.11
GitHub Action Run
3 windows - 39578520812.3 21 Oct 2026 09:40AM UTC 3
61.92
GitHub Action Run
Source Files on build 39578520812
  • Tree
  • List 35
  • Changed 7
  • Source Changed 5
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #39578520812
  • b005bd10 on github
  • Prev Build on master (#38253957651)
  • Next Build on master (#40502970730)
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