All problems

Rejected Lab Tasks Leak Equipment Pool Permits

Level 2 · node · Concurrency · Async permit not released when a task rejects

Scenario

A fictional laboratory execution service limits each equipment pool to one running task. A successful task releases its permit, but when an asynchronous task throws, the permit remains held and later requests are rejected as busy. Inspect the store, service, and controller.

Requirements

Release every acquired execution permit whether the task succeeds or throws. Propagate task errors to callers while preserving per-pool exclusion, independence across pools, and input validation.

Acceptance criteria

  • A failed task restores its pool's execution permit even when it throws.
  • A successful task returns its execution permit.
  • Only one task can run at a time in each equipment pool.
  • Different equipment pools execute tasks independently.
  • Invalid pool names and task functions are rejected.