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
If a user's code panics within a pop.Connection.Transaction closure, .Rollback nor .Commit will not be called resulting in a leaked SQL connection.
Steps to Reproduce the Problem
funcDoThing(conn*pop.Connection) {
_=conn.Transaction(func(tx*pop.Connection) error {
panic("Oh no, this is probably due to a null pointer exception!")
})
}
Expected Behavior
.Transaction should recover panics and attempt to call .Rollback before re-panicking the error.
Actual Behavior
A SQL connection is silently leaked. Depending on your connection pool setting, you might not even notice.
Info
This issue is not specific to an OS and is observable on the latest main commit (4e72fd8) as of writing
The text was updated successfully, but these errors were encountered:
Thank you for reporting the issue. It could be a serious issue if the transaction is not guaranteed even though the root cause is on the user's own code. Will check the sequence but it could take more time.
Description
If a user's code panics within a
pop.Connection.Transaction
closure,.Rollback
nor.Commit
will not be called resulting in a leaked SQL connection.Steps to Reproduce the Problem
Expected Behavior
.Transaction
shouldrecover
panics and attempt to call.Rollback
before re-panicking the error.Actual Behavior
A SQL connection is silently leaked. Depending on your connection pool setting, you might not even notice.
Info
This issue is not specific to an OS and is observable on the latest
main
commit (4e72fd8) as of writingThe text was updated successfully, but these errors were encountered: