I have a rails 3.x app that makes heavy use of remote apis using Active Resource. The api authentication data and urls called can change based on the users login. We want to deploy the app using jruby with config.threadsafe enabled to allow for concurrency. I've googled around and see that ares was pulled out of rails 4 because of potential threadsafety issues, but was wondering if anyone has already gone this route? Really I'm trying to decide if this is something that's a good idea after some modifications to code (possibly even monkey patching ares), or if it just is not possible/worthwhile. Any insight would be greatly appreciated. Links to resources also greatly appreciated.
Asked
Active
Viewed 43 times
1 Answers
0
I don't know of any reason that this should be an issue. You should try to make it work and then if you run into any problems you should post info about the errors you're seeing.

Jeremy Green
- 8,547
- 1
- 29
- 33
-
It's an issue because by default active resource is not thread safe (known issue). So when running in a threaded environment like jruby or puma, things like request headers are not safe. So if you need to make api requests with headers that are client specific there is no guarantee they will not be stepped on by another request. – d-coded Oct 14 '13 at 23:44
-
Ah, ok, sorry. I totally missed the part of your question where you mentioned that there are known thread safety issues. I can't be much help. Sorry, and good luck. – Jeremy Green Oct 14 '13 at 23:57