Skip to content

Fix job cancellation, orchestrator errors, queue race, lock release - #20

Merged
rickhohler merged 1 commit into
mainfrom
fix/async-work-correctness
Oct 25, 2026
Merged

rickhohler merged 1 commit into
mainfrom
fix/async-work-correctness

Conversation

@rickhohler

Copy link
Copy Markdown
Collaborator

fix-async-work-correctness (DesignAlgorithmsKit-Specs).

  • JobManager.cancel removes the pending job so it never runs
  • TaskOrchestrator wraps task errors in OrchestrationError.taskFailure
  • ProcessingQueue marks items .processing synchronously before spawning,
    bounding concurrency and starting each item once; drops finished handles
  • ResourceCoordinator releases locks before access returns, evicts idle
    per-key locks, adds withWriteLock(for:operation:)

Two queue tests relied on add/retry leaving items pending until a later
task ran; they now pause the queue first.

Tests: swift test passes 362 tests, three runs in a row. On the old code the new JobManager and TaskOrchestrator tests fail (the cancelled job ends .completed; the raw Boom error escapes). The queue and lock tests use the new API.

🤖 Generated with Claude Code

fix-async-work-correctness (DesignAlgorithmsKit-Specs).
- JobManager.cancel removes the pending job so it never runs
- TaskOrchestrator wraps task errors in OrchestrationError.taskFailure
- ProcessingQueue marks items .processing synchronously before spawning,
  bounding concurrency and starting each item once; drops finished handles
- ResourceCoordinator releases locks before access returns, evicts idle
  per-key locks, adds withWriteLock(for:operation:)

Two queue tests relied on add/retry leaving items pending until a later
task ran; they now pause the queue first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rickhohler
rickhohler merged commit 945f2fc into main Oct 25, 2026
1 check failed
@rickhohler
rickhohler deleted the fix/async-work-correctness branch October 25, 2026 00:43
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