Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lock_wait_timeout as retryable #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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