Skip to content
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

Release connections correctly #800

Merged

Conversation

matthewmcgarvey
Copy link
Member

Fixes #799

I think the original check was the opposite (if connection has no open transactions) and I forgot to negate when I switched to this method. The specs didn't catch it because almost all specs run within a transaction so they just so happened to always fall into this block 🤦.

I think the original check was the opposite (if connection has no open transactions) and I forgot to negate when I switched to this method
@@ -66,6 +66,11 @@ describe "Avram::SaveOperation" do
operation.saved?.should be_true
end
end

it "releases connection after operation finishes and no transactions open", tags: Avram::SpecHelper::TRUNCATE do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to truncate instead of wrap the specs in a transaction so that there will not be any open transactions left on the connection when the operation finishes.

@matthewmcgarvey matthewmcgarvey merged commit 519213e into luckyframework:master Jan 25, 2022
@matthewmcgarvey matthewmcgarvey deleted the release-connections-fix branch January 25, 2022 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latest Avram main results in "FATAL: sorry, too many clients already"
3 participants