EM.schedule stops running code block

18 views
Skip to first unread message

Chris Ochs

unread,
Jan 30, 2012, 3:00:02 PM1/30/12
to EventMachine
This is with jruby 1.6.5 and the latest release version of
eventmachine

We are using udp for logging to syslog and are running into a strange
bug. We run the reactor in it's own thread in rails, and call
send_datagram within an EM.schedule block. Following is the code I'm
using to track down where the issue is.

After several thousand messages, the code inside Em.schedule just
stops being called. The EM_SCHEDULE puts statement no longer
displays. This only happens during production, which makes me think
that it's barfing on some specific content.

In our load testing where the log messages are generally shorter and
not driven by real user data, we don't see this. We can send several
million messages without issue.

Any ideas?


def send_msg(data)
puts "SEND_MSG #{data}"
EM.schedule do
puts "EM_SCHEDULE"
begin
@syslog_sd.send_datagram(data, @syslog_server,
@syslog_port)
rescue Exception => e
puts "LOG_ERROR: #{data}\n\n #{e.message}
#{e.backtrace.join("\n")}"
end
end
end

James Tucker

unread,
Feb 10, 2012, 1:56:59 AM2/10/12
to eventm...@googlegroups.com
The reactor thread probably died for some reason. Try calling join on it.

> --
> You received this message because you are subscribed to the Google Groups "EventMachine" group.
> To post to this group, send email to eventm...@googlegroups.com.
> To unsubscribe from this group, send email to eventmachine...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/eventmachine?hl=en.
>

Reply all
Reply to author
Forward
0 new messages