Skip to content

Conversation

@habdelra
Copy link
Contributor

This PR fixes an issue where when a running job was cancelled from grafana the worker would be tainted in such a way that it was unable to pick up new work.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where cancelling a running job from Grafana would prevent workers from picking up new jobs. The root cause was that only one job reservation was being marked as completed during cancellation, leaving other reservations incomplete and blocking the concurrency group.

Changes:

  • Modified forceJobCompletion to complete all uncompleted reservations for a job instead of just one
  • Updated tests to verify multiple reservations are properly completed
  • Added a comprehensive integration test demonstrating the fix allows subsequent jobs to run after cancellation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/realm-server/handlers/handle-remove-job.ts Updated forceJobCompletion to mark all uncompleted reservations as completed instead of just a specific one, and simplified the function signature
packages/realm-server/tests/server-endpoints/maintenance-endpoints-test.ts Added test imports, updated existing tests to create multiple reservations, and added comprehensive integration test verifying workers can pick up new jobs after cancellation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@habdelra habdelra requested a review from a team January 23, 2026 15:28
@github-actions
Copy link

Host Test Results

    1 files  ±0      1 suites  ±0   1h 42m 45s ⏱️ +42s
1 903 tests ±0  1 886 ✅ ±0  17 💤 ±0  0 ❌ ±0 
1 918 runs  ±0  1 901 ✅ ±0  17 💤 ±0  0 ❌ ±0 

Results for commit 8b6d529. ± Comparison against base commit e8ef4e1.

@habdelra habdelra merged commit aa2df31 into main Jan 23, 2026
91 checks passed
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.

3 participants