-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add compatibility with Fiber-safe ConnectionPool in Rails 7.1 #349
Comments
Hi thanks for reporting this. The test suite contains a fixture app of Rails 7 so hopefully if we switch this on it will be easy to reproduce. |
I should note this happens after 6 requests in sequence, assuming they each make one database query, or I believe a single request that makes 6 or more queries. Assuming pool size is the rails default of 5 |
@apotterri this could be worth a look? |
A workaround would be to stick with thread-based isolation when (a) in development and (b) AppMap is enabled. |
@swrobel Would you mind providing some extra info on your Rails app configuration so we can easily replicate the issue? From your backtrace, I see that you are using Rails 7.1.2 and GraphQL. Some questions:
Thanks! |
|
Thank you for this information. I have created an article on creating a GraphQL Rails app that will hopefully mimic what you have built (see Load Testing GraphQL with Rails) I will download and test with Altair. Thanks for the link! You mentioned that you submitted the request 6 times in a row. Was that simply pressing the button again and again quickly? If so, are the queries that are being executed pretty large? Thanks! |
Correct
I wouldn't say so. I'm able to do the same indefinitely when I don't have appmap in my gemfile, or I don't have the fiber pool enabled. |
@swrobel Gotcha. Are you running a fiber-based server or job processor (any of these)? I am still unable to replicate this issue.
Does this happen without the AppMap gem but with fiber pool enabled? |
No it does not. I'm using Puma. I've never tried falcon. |
@swrobel Which version or Ruby are you using? |
@coderberry 3.3.0 |
This issue is being discussed here: rmosolgo/graphql-ruby#4874. |
Rails 7.1 added opt-in
config.active_support.isolation_level = :fiber
in rails/rails#44219 to replace Threads with more modern Fiber-based concurrency primitives that are available in 3.x versions of Ruby, but unfortunately appmap seems to cause conflicts with this setting that prevents database connections from being released to the pool, resulting in:The text was updated successfully, but these errors were encountered: