Skip to content

Bug: Multiple rows in a function may cause a problem #663

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

Closed
capt4ce opened this issue Mar 16, 2020 · 0 comments · Fixed by #675
Closed

Bug: Multiple rows in a function may cause a problem #663

capt4ce opened this issue Mar 16, 2020 · 0 comments · Fixed by #675
Assignees
Labels
BUG Something isn't working

Comments

@capt4ce
Copy link
Contributor

capt4ce commented Mar 16, 2020

Description

Based on the simulation in a simple gist https://gist.github.com/capt4ce/311e443567792d6612eec90631efb981, it's found that if there are 2 executions of sql.DB.Query() in a function and the result.Close() of both of them using defer, it may risk DB deadlock.

Steps to reproduce

Try running the gist, the it will stuck after all the connections are used.

Expected behavior

The rows need to be closed well to avoid DB deadlock.

@capt4ce capt4ce self-assigned this Mar 16, 2020
@capt4ce capt4ce added the BUG Something isn't working label Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant