Skip to content

Conversation

@morgo
Copy link

@morgo morgo commented Jan 11, 2023

Lock wait timeout should be retryable.

I've added a test, which works. I had to locally add a go-mod file, but I've not committed it.

For some reason the TestMySQLDown() test is not working for me on 8.0.31, but since it's unrelated I've ignored that for now.

Comment on lines -24 to -40
// SAVE_ITEM_LOOP:
// for tryNo := 1; tryNo <= maxTries; tryNo++ {
// if err := SaveItem(item); err != nil {
// if ok, myerr := my.Error(err); ok { // MySQL error
// if myerr == my.ErrDupeKey {
// return http.StatusConflict
// }
// if my.CanRetry(myerr) {
// time.Sleep(1 * time.Second)
// continue SAVE_ITEM_LOOP // retry
// }
// }
// // Error not handled
// return http.StatusInternalServerError
// }
// break SAVE_ITEM_LOOP // success
// }
Copy link
Author

Choose a reason for hiding this comment

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

Sorry, this is go 1.19 go fmt related. I would manually unapply, but since most editors do this the next person will just commit this change anyway :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants