-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeout on results_native.rb:139 when run through Puma server #3
Comments
Breaking news, under Thin, it does not work either, but it's another error : /usr/local/bundle/bundler/gems/libcouchbase-42d248ea3a39/lib/libcouchbase/results_fiber.rb:264:in 🤔 When played from a non-web environment (Rspec or @stakach I read on another thread that you were using couchbase-orm in production environment, which webserver are you using for that ? |
Awesome, thanks for letting me know - I'll take a look today |
We have it running on Puma and a web server of my own concoction called spider-gazelle. Are you certain that the production server can communicate with the database? |
Puma executes requests in the same way that In all environments requests technically execute in async however on platforms that don't play well with async we use mutex's and condition variables to signal when results are available. So progress is blocked by the mutex. My best guess on the issues you are experiencing are either an older broken version of the library is in use or some ports not open between the server and all database nodes |
Hi, thanks for you answers, after a lot of debug, I decided to build a simple rails app from scratch, and implement a simple couchbase-orm model in it. And.... it works ! So I guess this is a compatibility issue with another gem in my existing app. Time to figure out which one now :) |
Are you certain you are running the latest libcouchbase? Also when you tested your production environment in Thin were you using rack-fiber_pool? As that probably caused the root fiber error if you were not using it |
Also I haven't tested Puma in clustered mode. |
Clustered mode seems to be OK as my new project has the exact same configuration file than the first project. If your talking about the libcouchbase gem, yes, I use the lastest one. If you mean the underlying lib, I use libcouchbase from apt repo. Do you think it is outdated ? Here is my install command line Youre right, I didn't use rack-fiber-pool. I'll try, it may solve the issue at least for Thin. |
The libcouchbase gem is actually bundled with the libcouchbase library - compiles when you install. So no need to install apt-get versions of libcouchbase |
Really ?? Oh nice to know. I'll try without the apt. |
OK !! It works. Believe it or not, it was a Rails.application.eager_load! hidden in a initializer that was causing the problem. My understanding of it, is that loading occurs before couchbase-orm can effectively connect to the server. After that, it is stuck in the middle of the road and cannot reconnect properly. 2 days to figure out. Damn. Thanks for your precious help. Reaaally appreciated. |
Hey @stakach it's me again. Funny enough, in staging and production environment, eager_loading is recommended and configured by default in rails config files. Which makes the bug appear again :( How did you get it working ? Did you bypassed eager_loading ? |
For your information, one can workaround this issue by moving CouchbaseOrm classes into their own folder at the root of the rails app, and then integrate this path to autoload_paths : This exclude the models from eager_loading, but keep them available at runtime. So far so good :) |
Hi ! Downgrade to Rails 4 went good, and I could implement couchbase-orm on my existing cassandra objects with ease. This is awesome !
In development environment (Thin) everything works. But in staging/prod we use Puma, and every call to Couchbase times out on line 139 of results_native. I guess this has to do with async management, but I don't see any config in the source. Any thoughts ?
When everything will be allright, I'll be happy to make a pull request with small improvements I made (Rails4 compat, and compound-keys in views).
Thanks a lot !
The text was updated successfully, but these errors were encountered: