Open mighe opened 9 years ago
Let me know what you find on this.
@digitalextremist @kenichi I'm able to reproduce it! :+1:
require 'angelo'
require 'json'
class AngeloStressTest < Angelo::Base
websocket '/' do |ws|
websockets << ws
end
task :custom_event do |event|
websockets.each { |ws| ws.write event.to_json }
end
end
s = AngeloStressTest.run
Thread.new do
loop do
sleep(1)
3.times { s.custom_event( {a: 'hello' * 10E6} ) }
print '*'
end
end
puts 'started'
gets
Just run that and open a websocket from your browser. I suspected it was an issue related to heavy traffic, because I first saw this adding components to my backend, with this simple code we're simulating a situation with many events sent fast.
Usually this sort of thing happens when you start multiple server instances on top of each other, but I would need to look further into angelo to fully see the implications of your repro.
hmm, it seems to be somewhere between 10E4 and 10E5 as the multiplier that the error is raised. prior to that size of message, it seems to work.
the error in question seems to be coming from NIO::Selector#register
?
My code production code sends short strings (usually less than 5000 characters), but sometimes I got that error. Probably is somehow related to the (wi-fi) network speed or something like that, in this example I use a big constant to reproduce the issue consistently on localhost
This happened a couple of times:
calling this task:
I saw this error a couple of times recently. Do you think it can be an Angelo issue or can it be a problem of one of its dependency? I found this