Skip to content

Avoid draining pool in gardener cleanup#26

Open
wtn wants to merge 1 commit intosocketry:mainfrom
wtn:gardener
Open

Avoid draining pool in gardener cleanup#26
wtn wants to merge 1 commit intosocketry:mainfrom
wtn:gardener

Conversation

@wtn
Copy link
Copy Markdown
Contributor

@wtn wtn commented Mar 13, 2026

When a Sync scope exits while the gardener is waiting, Async::Cancel interrupts @condition.wait(@mutex) inside @mutex.synchronize, producing a ThreadError warning. The gardener's ensure also called self.closedrain, which could block if resources are still acquired during teardown.

warn: Async::Task: Async::Pool::Controller Gardener
  Task may have ended with unhandled exception.
    ThreadError: Attempt to unlock a mutex which is not locked
    → async-pool-0.11.2/lib/async/pool/controller.rb:132 in `synchronize'
    Caused by Async::Cancel: Task was cancelled

The gardener's ensure now force-retires resources directly instead of calling close/drain.

Types of Changes

  • Bug fix.

Contribution

Co-authored-by: Claude <noreply@anthropic.com>
@wtn wtn changed the title Avoid draining pool in gardener cleanup. Avoid draining pool in gardener cleanup Mar 13, 2026
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