feat: implement proper task cancellation for scheduled jobs#2731
Merged
feat: implement proper task cancellation for scheduled jobs#2731
Conversation
- Add update_schedule method to scheduler backend
- Add PUT /schedule/{id} API endpoint for updating cron expressions
- Create EditScheduleModal component with cron validation and preview
- Add edit buttons to both schedule list and detail views
- Include toast notifications for successful/failed updates
- Prevent editing schedules while they are currently running
- Update OpenAPI schema and regenerate frontend API client
- Add individual loading states for pause/unpause and delete actions - Buttons now disable immediately when clicked to prevent race conditions - Edit button disabled during any other action on the same schedule - Add loading text feedback (e.g., 'Pausing...', 'Unpausing...') - Fix race condition where users could click Edit after Run Now - Apply fix to both SchedulesView (list) and ScheduleDetailView (detail) - Maintain proper button states across all schedule operations
- Add running_tasks map to track abort handles for active jobs - Store abort handles when spawning job execution tasks - Implement actual task termination in kill_running_job method - Add comprehensive error handling for cancelled vs failed jobs - Update job execution to use tokio::spawn with stored abort handles - Ensure proper cleanup of abort handles after job completion
- Add running_tasks map to track abort handles for active jobs - Store abort handles at scheduler level for both cron and run_now jobs - Implement actual task termination in kill_running_job method - Add comprehensive error handling for cancelled vs failed jobs - Update job execution to use tokio::spawn with stored abort handles - Ensure proper cleanup of abort handles after job completion - Fix run_now jobs to be properly abortable with stored handles Jobs can now be properly killed and will immediately stop execution instead of continuing to run in the background.
b744c08 to
407187c
Compare
zanesq
approved these changes
May 29, 2025
lifeizhou-ap
added a commit
to lifeizhou-ap/goose
that referenced
this pull request
May 30, 2025
* upstream/main: fix: protobuf install in build (block#2714) feat: implement proper task cancellation for scheduled jobs (block#2731) docs: blog readme (block#2728)
GitMurf
pushed a commit
to GitMurf/goose
that referenced
this pull request
May 30, 2025
cbruyndoncx
pushed a commit
to cbruyndoncx/goose
that referenced
this pull request
Jul 20, 2025
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.
schedule_kill.mp4