Tags: karafka/waterdrop
Tags
Fix Producer#close raising ThreadError when called from a signal trap… … context (#867) Puma's `after_stopped` DSL hook in single mode runs in a Ruby signal trap context. Ruby forbids Mutex#synchronize from trap contexts and raises: ThreadError: can't be called from trap context Producer#close calls @transaction_mutex.synchronize, which hits this restriction. The fix rescues ThreadError at the method level and re-runs close in a background thread, joining it so the caller blocks until the producer is fully closed. This mirrors the existing pattern used to escape the fd-poller thread deadlock. Closes #866
PreviousNext