Closed selivandex closed 10 years ago
Fiber.new{ your_call }.resume
This can fix a lot of issues, but your mileage may vary.
@KazW's solution should fix your problem if EventMachine is running. The cause of the problem has to do with the EM::Synchrony Redis driver.
If you are running this from a background process that does not have EventMachine running you can work around this by changing the redis driver that WebsocketRails uses.
In the initialization of that process you could add the following code:
WebsocketRails.setup do |config|
config.redis_options = {driver: :ruby}
end
You can also add any of the other available Redis options to that hash as it's passed directly to the Redis client.
Well, my problem is the whole rails application will be stucked and can only be killed by SIGKILL after booted up, if i specified a redis driver, such as hiredis
or ruby
.
I too ran into this issue (while using Sidekiq). Using the ruby
driver did also lock my processes like @yanke-guo, and since Sidekiq doesn't use EventMachine, I guess using new { ... }.resume
is not an option.
Any other ideas?
+1 for me
+1
Why is this closed? Sounds like the workaround is not applicable to the original report.
@aceofspades Fiber.new{ your_call }.resume
did solve it for me by the way.
See https://github.com/kabisaict/flow/commit/811d5de8e22aec254270a467a60b4d19e25dfdd5 for an example.
Thanks for the link @JeanMertz
+1
Is there some workaround here that doesn't involve forking this repo? All I could find to fix my server crash
synchrony.rb:78:in `resume': double resume (FiberError)
was here:
https://github.com/Bivek/websocket-rails/commit/208e7521f2be4e56f284472a6a07b740f3052537
[edit]
ok, hmmmm adding
config.redis_options = {driver: :ruby}
into config/websocket_rails.rb did not fix the problem, argh. I actually had to go into lib/websocket_rails/synchronization.rb and comment out the synchrony include line to even get my rails server to serve a single page with this gem installed. I'd say "critical bug".
I trying to trigger some event In standalone mode and getting error
This is full stack
Somebody knows what i doing wrong?