Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix running job cancellation when not fetching #678

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

bgentry
Copy link
Contributor

@bgentry bgentry commented Nov 14, 2024

Cancellation of running jobs relied on a channel that was only being
received when in the job fetch routine, meaning that jobs which were
cancelled would not be cancelled until the next scheduled fetch.

This was fixed by also receiving from the job cancellation channel when
in the main producer loop, even if no fetches are happening.

@bgentry bgentry requested a review from brandur November 14, 2024 21:33
client_test.go Outdated
Comment on lines 518 to 516
t.Parallel()
t.Run("AlternateSchema", func(t *testing.T) {

client, _ := setup(t)
t.Run("CancelRunningJobInTx", func(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what happened here 🤦‍♂️ fixing

@bgentry bgentry force-pushed the bg-fix-cancellation-outside-fetch branch from 37af32d to f0d65ab Compare November 15, 2024 15:23
Cancellation of running jobs relied on a channel that was only being
received when in the job fetch routine, meaning that jobs which were
cancelled would not be cancelled until the next scheduled fetch.

This was fixed by also receiving from the job cancellation channel when
in the main producer loop, even if no fetches are happening.
@bgentry bgentry force-pushed the bg-fix-cancellation-outside-fetch branch from f0d65ab to f1ba47a Compare November 15, 2024 15:30
@bgentry bgentry merged commit e9cbdd0 into master Nov 15, 2024
10 checks passed
@bgentry bgentry deleted the bg-fix-cancellation-outside-fetch branch November 15, 2024 15:34
tigrato pushed a commit to gravitational/river that referenced this pull request Dec 18, 2024
* fix running job cancellation when not fetching

Cancellation of running jobs relied on a channel that was only being
received when in the job fetch routine, meaning that jobs which were
cancelled would not be cancelled until the next scheduled fetch.

This was fixed by also receiving from the job cancellation channel when
in the main producer loop, even if no fetches are happening.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant