Consistent Timeouts After "1062" Duplicate Entry Errors #27
-
I have noticed that whenever I get a uniqueness constraints error, the following INSERT/DELETE queries always get timed out. To reproduce:
func main() {
// this works
tx, err := db.Begin()
must(err)
_, err = tx.Exec(`INSERT INTO users (email) values ('one')`)
must(err)
must(tx.Commit())
// force a duplicate entry error
tx, err = db.Begin()
must(err)
_, err = tx.Exec(`INSERT INTO users (email) values ('one')`)
if err == nil {
must(fmt.Errorf("expected a duplicate entry error"))
} else {
// rollback the transaction
fmt.Println(tx.Rollback())
}
// This is where the bug is:
tx, err = db.Begin()
must(err)
_, err = tx.Exec(`DELETE FROM users`)
must(err) // the error happens here after a 20 second timeout
must(tx.Commit())
}
func must(err error) {
if err != nil {
panic(err)
}
} I end up with the following error:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Verified manually (using Our engineering team is looking into it. |
Beta Was this translation helpful? Give feedback.
-
This should be fixed as well. Thanks for the report! |
Beta Was this translation helpful? Give feedback.
This should be fixed as well. Thanks for the report!