Closed dmvt closed 10 years ago
Seems to be an issue with the firebase-ruby gem http://stackoverflow.com/questions/20211707/quick-multiple-calls-to-firebase-crashes-rails https://github.com/oscardelben/firebase-ruby/issues/15
@bluefocus Thanks for reporting!
Same exception here, it segfaults and brings down sidekiq.. this is in Ubuntu Server (in a production environment).
I am sorry to hear that
Any plans to fix this? We fixed it ourselves but our solution is specific to our use case.
I don't know how to fix it - do you?
Our solution wasn't ideal, we had to wrap the requester in a semaphore which serialized the sending of requests but was better than crashing. Ideally, the requests should be able to happen in parallel but the way Typheous is doing requests (whatever clib it's using or relying on) doesn't let you do it.
oh. With Typhoeus you cannot use the same hydra across multiple threads. is it that what you are describing?
I believe so.. we were using a gem (firebase-ruby) which was using Typheous to do stuff. But when we pushed the requests into Sidekiq it was blowing up. Even when instantiating a new firebase-ruby client for each thread it would blow up so we didn't know what else to do.
I think I found the issue: https://github.com/oscardelben/firebase-ruby/blob/master/lib/firebase/request.rb#L45.
I assume it should just create a new Hydra instance instead of lazy loading one?
I responded here: https://github.com/oscardelben/firebase-ruby/issues/15#issuecomment-46654551. It should use Typhoeus::Hydra.hydra
which memoizes the hydra correctly in a thread local variable.
Thanks!
Will it be fixed in the future?
@titibouboul It already is. This turned out not to be a Typhoeus problem.
@i0rek I'm still getting this error using firebase-ruby (0.2.2) with Sidekiq - similar to @prophittcorey. Was there anything to be resolved here or is it up to the firebase maintainers?
It's a firebase-ruby problem. I submitted a fix to firebase-ruby and I believe it's in the repository, but they never released a rubygem update.
@thebucknerlife @prophittcorey is right. There is a fix in master.
Thanks @i0rek and @prophittcorey I'm going to update Gemfile to pull from firebase-ruby master. See if that fixes it.