Skip to content

fix(task): recover blocked scheduled executions#124

Merged
duguwanglong merged 2 commits intomainfrom
fix/task-scheduler-blocking
Apr 15, 2026
Merged

fix(task): recover blocked scheduled executions#124
duguwanglong merged 2 commits intomainfrom
fix/task-scheduler-blocking

Conversation

@xiami762
Copy link
Copy Markdown
Contributor

@xiami762 xiami762 commented Apr 15, 2026

Summary

  • add hard timeouts, stale-running recovery, and diagnostics so blocked scheduled executions stop holding the task queue forever
  • fail fast when scheduled/background tasks try to wait for user input and wire workflow task cancellation into the existing workflow CANCELLED semantics
  • raise default task concurrency to 4 so different schedulers can run concurrently by default

Test plan

  • uv run pytest tests/server/test_server.py tests/task/test_task.py tests/integration/test_task_queue_integration.py
  • uv run pytest tests/integration/test_task_queue_integration.py tests/task/test_task.py tests/workflow/test_workflow_cancellation.py tests/server/test_server.py
  • uv run ruff check flocks/task/queue.py flocks/task/manager.py tests/server/test_server.py
  • uv run ruff check flocks/task/executor.py flocks/task/manager.py tests/integration/test_task_queue_integration.py

xiami762 added 2 commits April 15, 2026 11:55
Add hard timeouts, stale-running recovery, workflow cancellation wiring, and queue diagnostics so scheduled tasks stop getting stuck behind orphaned executions while allowing different schedulers to run concurrently by default.

Made-with: Cursor
…g executions

Compare elapsed seconds directly instead of mixing started_at with
oldest_running_seconds, which could pick the wrong execution when
multiple RUNNING tasks exist. Add regression test for two concurrent
running executions with different start times.

Made-with: Cursor
@duguwanglong duguwanglong merged commit 363651b into main Apr 15, 2026
2 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.

2 participants