-
-
Notifications
You must be signed in to change notification settings - Fork 254
Closed
Labels
bugSomething isn't workingSomething isn't workings: fixedwas fixed or solution offeredwas fixed or solution offered
Milestone
Description
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
func DoThing(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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workings: fixedwas fixed or solution offeredwas fixed or solution offered