You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 theresult.Close()
of both of them usingdefer
, 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.
The text was updated successfully, but these errors were encountered: