Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,11 @@ func (s *stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (drive
// Note: We respond to cancellation on the primary context (ctx) not
// the cleanup context (pctx).
if ctx.Err() != nil {
db.Interrupt()
if s.closed.Load() {
UsesAfterClose.Add("stmt.ExecContext.Interrupt", 1)
} else {
db.Interrupt()
}
Comment on lines +582 to +586
Copy link
Member

Choose a reason for hiding this comment

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

there's still a potential race here. we need to hold a mutex during Interrupt + Close.

}
})

Expand Down Expand Up @@ -652,7 +656,11 @@ func (s *stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driv
// Note: We respond to cancellation on the primary context (ctx) not
// the cleanup context (pctx).
if ctx.Err() != nil {
db.Interrupt()
if s.closed.Load() {
UsesAfterClose.Add("stmt.QueryContext.Interrupt", 1)
} else {
db.Interrupt()
}
}
})
// In this case we do not have an early exit, so we don't need to
Expand Down
Loading