No events when using JRuby
-
Jay Phillips
- State changed from new to open
-
jsgoecke
I tested this again with the newly released JRuby 1.1.6, unfortunately the issue persists. I ran a test with MRI, did a reload on the Asterisk CLI and get events. I used JRuby in the same scenario and no events, the log is here:
-
jsgoecke
Added a bit of debug code and have managed to at least capture at some point where this issue is happening. I added a begin/rescue clause to the manager_interface.rb here:
def event_message_received(event) return if event.kind_of?(ManagerInterfaceResponse) && event["Message"] == "Authentication accepted" # TODO: convert the event name to a certain namespace. begin Events.trigger %w[asterisk manager_interface], event rescue => err ahn_log.event_error err abort end endAnd, when an event is generated, I get this error in JRuby:
INFO event_error: Caught ArgumentError: wrong # of arguments(1 for 2)
/opt/adhearsion/lib/theatre/invocation.rb:35:in `initialize' /opt/adhearsion/lib/theatre.rb:44:in `trigger' /opt/adhearsion/lib/theatre.rb:40:in `map' /opt/adhearsion/lib/theatre.rb:40:in `trigger' /opt/adhearsion/lib/adhearsion/events_support.rb:43:in `trigger' /opt/adhearsion/lib/adhearsion/voip/asterisk/manager_interface.rb:203:in `event_message_received' /opt/adhearsion/lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb:1739:in `message_received'I run a test with the rescue clause in there on MRI and the error is not raised.
-
jsgoecke
Okay, it appears to be somewhere within Theatre and specifically with the standard Monitor library. I added this begin/rescue clause to the theatre/invocation.rb:
begin ahn_log.monitor_issue @returned_value_lock.inspect @returned_value_blocker = Monitor::ConditionVariable.new @returned_value_lock rescue => err ahn_log.monitor_issue err abort endAnd, if I inspect the returning lock with MRI (when it works) I get this:
INFO monitor_issue: #<Monitor:0x18df6e8 @mon_entering_queue=[], @mon_count=0, @mon_owner=nil, @mon_waiting_queue=[]>
When I do the same with JRuby I get this:
INFO monitor_issue: #<Monitor:0x521927 @mon_waiting_cond=#<ConditionVariable:0xf15e7a>, @mon_total_waiting=0, @mon_entering_cond=#<ConditionVariable:0x71d99e>, @mon_count=0, @mon_mutex=#<Mutex:0x862be4>, @mon_owner=nil>
Obviously different, but not sure what the offending difference is yet.
-
Jay Phillips
- State changed from open to resolved
Fixed. I just changed
@returned_value_blocker = Monitor::ConditionVariable.new @returned_value_lockto
@returned_value_blocker = @returned_value_lock.new_cond
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.