-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Lock / contention when not using a transaction and exceeding pool limit #28
Comments
I'm seeing some strange behavior where requests are being retried upon failure and my hunch is that it has something to do with the transaction middleware. Did you get any insight into your issues? |
Hi @matthewbordas, Thanks for your comment. Does your experience match this issue's description? Actually, I didn't have a look at this issue yet but will check it as soon as possible. If you could provide more details, it could be helpful to understand the issue more clearly. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days. |
@sio4, how do recent changes in Pop affect this issue? |
This issue still exists. I improved Pop's logging so users can track transaction/connection information better, so they can imagine what happened when they use pop middleware and the raw I have no solid idea for now, even though I am thinking about it, and I think fixing this without API/design change could not be possible (since we expose and use context's Also, there are related considerations such as supporting "multiple databases (or data sources) in a single app", "multiple connections/transactions in a single handler", and "explicit transaction" (not automated by middleware per a single handler). |
I've discovered (the hard way) that if you use the transaction middleware
app.Use(popmw.Transaction(models.DB))
, but you DO NOT use the transaction in a request handler (i.e. just usemodels.DB
directly), the entire application will lock up if the number of concurrent requests exceeds yourpool
setting for the DB connection.To test this, create a new buffalo app. Configure the database and add some sample data. Sample config:
In a handler, query the db and DO NOT use the
tx
stored in context, example:Make concurrent requests to the endpoint exceeding the
pool
, I did 10 concurrent requests. The application will completely lock up and not respond at all. Removing the transaction middleware eliminates the problem.The text was updated successfully, but these errors were encountered: