Fix "forbid" concurrency check to survive node restarts#1870
Merged
Conversation
… for running executions Co-authored-by: vcastellm <47026+vcastellm@users.noreply.github.com>
Co-authored-by: vcastellm <47026+vcastellm@users.noreply.github.com>
Co-authored-by: vcastellm <47026+vcastellm@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix forbid concurrent option to verify running jobs
Fix "forbid" concurrency check to survive node restarts
Dec 14, 2025
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1870 +/- ##
==========================================
+ Coverage 31.68% 31.76% +0.08%
==========================================
Files 76 76
Lines 6937 6963 +26
==========================================
+ Hits 2198 2212 +14
- Misses 4436 4446 +10
- Partials 303 305 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
When a node crashes and restarts, jobs with
concurrency: "forbid"incorrectly allow concurrent execution. The issue occurs because the forbid check relies on an in-memoryactiveExecutionsmap that is cleared on restart, missing jobs still running on other nodes.Changes:
GetRunningExecutions()method to query persistent storage for executions withStartedAtbut noFinishedAtisRunnable()to check persistent storage first, then fall back to in-memory stateThe fix uses BuntDB (already persisted) as the source of truth for running executions, making the forbid check resilient to node failures and restarts.
Types of changes
What types of changes does your code introduce?
Put an
xin the boxes that applyWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
127.0.0.10/tmp/go-build2632617950/b001/dkron.test /tmp/go-build2632617950/b001/dkron.test -test.testlogfile=/tmp/go-build2632617950/b001/testlog.txt -test.paniconexit0 -test.v=true -test.timeout=3m0s HcS8Y-jUi .cfg ux_amd64/vet -p g/protobuf/ptype-test.testlogfile=/tmp/go-build1927090654/b001/testlog.txt -lang=go1.23 ux_amd64/vet -o om/cenkalti/back-test.run=TestStore_GetRunningExecutions om/cenkalti/backoff/v5@v5.0.3/er-ifaceassert ux_amd64/vet points.go /tools/clientcmd-V=full -lang=go1.21 ux_amd64/vet(packet block)127.0.0.11/tmp/go-build2632617950/b001/dkron.test /tmp/go-build2632617950/b001/dkron.test -test.testlogfile=/tmp/go-build2632617950/b001/testlog.txt -test.paniconexit0 -test.v=true -test.timeout=3m0s HcS8Y-jUi .cfg ux_amd64/vet -p g/protobuf/ptype-test.testlogfile=/tmp/go-build1927090654/b001/testlog.txt -lang=go1.23 ux_amd64/vet -o om/cenkalti/back-test.run=TestStore_GetRunningExecutions om/cenkalti/backoff/v5@v5.0.3/er-ifaceassert ux_amd64/vet points.go /tools/clientcmd-V=full -lang=go1.21 ux_amd64/vet(packet block)127.0.0.13/tmp/go-build2632617950/b001/dkron.test /tmp/go-build2632617950/b001/dkron.test -test.testlogfile=/tmp/go-build2632617950/b001/testlog.txt -test.paniconexit0 -test.v=true -test.timeout=3m0s HcS8Y-jUi .cfg ux_amd64/vet -p g/protobuf/ptype-test.testlogfile=/tmp/go-build1927090654/b001/testlog.txt -lang=go1.23 ux_amd64/vet -o om/cenkalti/back-test.run=TestStore_GetRunningExecutions om/cenkalti/backoff/v5@v5.0.3/er-ifaceassert ux_amd64/vet points.go /tools/clientcmd-V=full -lang=go1.21 ux_amd64/vet(packet block)127.0.0.14/tmp/go-build2632617950/b001/dkron.test /tmp/go-build2632617950/b001/dkron.test -test.testlogfile=/tmp/go-build2632617950/b001/testlog.txt -test.paniconexit0 -test.v=true -test.timeout=3m0s HcS8Y-jUi .cfg ux_amd64/vet -p g/protobuf/ptype-test.testlogfile=/tmp/go-build1927090654/b001/testlog.txt -lang=go1.23 ux_amd64/vet -o om/cenkalti/back-test.run=TestStore_GetRunningExecutions om/cenkalti/backoff/v5@v5.0.3/er-ifaceassert ux_amd64/vet points.go /tools/clientcmd-V=full -lang=go1.21 ux_amd64/vet(packet block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.