-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
Fix IntegrityError with unique field and get_or_create #302
Conversation
@abondar based this on your original attempt to fix this. Please review. |
Pull Request Test Coverage Report for Build 1338
💛 - Coveralls |
Wow, Py3.6 gets so confused with contexts 😭 Unfortunately it would mean dropping pypy too. I'll just conditionally skip the test for now. |
Another option is to disable all connection pooling on py3.6? |
wow didn't expect pooling to be such a major pain on 3.6 but personally i'm more in favor for dropping only specific features on a version like pooling then dropping an entire version (prob best to log a warning on startup though so people are aware) |
Py3.6 uses a contextvar backport, and unfortunately it has shortcomings. py3.7+ has extra state in their asyncio C-structs to keep track better. |
i think forcing a shared lock instead of making new locks for concurrent operations should do the trick that and forcing a poolsize of 1 regardless since it can't use multiple so there is no reason to have any extras open |
Well, in the meantime I'm getting hillarious errors, like "cannot rollback; the transaction is not yet started" but investigating further the cause is the dreaded "cannot perform operation: another operation is in progress". And fixing race conditions fixes that. |
@AEnterprise We are discussing the potential deprecation for py3.6 in #303 |
I'll cherry pick the commits instead. |
Fixes #140
Had to introduce an extra lock for nested transactions for DB's that support it to prevent network errors with both PostgreSQL & MySQL.