Found one tricky issue in the query cancellation that we had discussed previously.
It is easy to reproduce when query completes quickly like in case of in-memory DB and checkpoint query. Example below:
func main() {
db, err := sql.Open("duckdb", "")
if err != nil {
log.Fatal(err)
}
defer db.Close()
conn, err := db.Conn(context.Background())
if err != nil {
log.Fatal(err)
}
var wg sync.WaitGroup
wg.Add(100)
for i := 0; i < 100; i++ {
v := i
go func() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
defer wg.Done()
_, err = conn.ExecContext(ctx, "CHECKPOINT;")
if err != nil {
log.Printf("err %v", err)
}
fmt.Printf("iteration %v done\n", v)
}()
}
wg.Wait()
}
Hey @marcboeker
Found one tricky issue in the query cancellation that we had discussed previously. It is easy to reproduce when query completes quickly like in case of in-memory DB and checkpoint query. Example below:
cc : @begelundmuller