Open fwoeck opened 9 years ago
After I updated has-guarded-handlers to the current dev branch, it seems to be gone. Will close this for now, thanks for your time anyway ;)
As far as I know, HGH 1.6.0 and the dev branch are the same, no?
This also happened to us yesterday in one of our servers
Hmm, indeed the HGH commits from august seem to be unrelated. I this case, I'll better reopen this. Better move the issue there?
wanted to fill in some details (for the record at least) related to why this is happening (on JRuby) :
the issue relates to an optimization PB::Asterisk::Call no longer being an actor. Call
class includes HasGuardedHandlers
. such Call instances during a (call) lifecycle might get accessed concurrently due Celluloid
doing message dispatching using Fibers which under JRuby are thread based. so sometimes unregister_handler
from _punchblock-266cb0230751/lib/punchblock/translator/asterisk/component/stop_byredirect.rb:21 might happen before an event handler gets fired (event handling is complete) :
punchblock-266cb0230751/lib/punchblock/translator/asterisk/call.rb:184:in `process_ami_event'
punchblock-266cb0230751/lib/punchblock/translator/asterisk.rb:230:in `ami_dispatch_to_or_create_call'
punchblock-266cb0230751/lib/punchblock/translator/asterisk.rb:228:in `each_pair'
punchblock-266cb0230751/lib/punchblock/translator/asterisk.rb:228:in `ami_dispatch_to_or_create_call'
punchblock-266cb0230751/lib/punchblock/translator/asterisk.rb:112:in `handle_ami_event'
celluloid-7af615463b10/lib/celluloid/calls.rb:25:in `public_send'
celluloid-7af615463b10/lib/celluloid/calls.rb:25:in `dispatch'
there's several approaches getting around the issue (personally believe reverting is not necessary as its a considerable improvement). we ended up making HGH
"much-more" thread-safe - handling event de-registration while executing handlers at the same time. which seems like too much and might need a review based on a concrete application but seemed to handle the occasional call failures well enough.
Now and then I see this error during load testing. The version is current dev-branch of punchblock. If helpful, I can easily add a debug log & sip-pcaps. Logically, I'm not so sure, why this happens - it's hard to reproduce reliably: