Add timeout for mysqld_shutdown#6849
Merged
deepthi merged 10 commits intovitessio:masterfrom Oct 22, 2020
Merged
Conversation
added 6 commits
October 10, 2020 00:53
…down before aborting Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
…sses Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
ajm188
commented
Oct 10, 2020
| // shutdown mysqld | ||
| err = params.Mysqld.Shutdown(ctx, params.Cnf, true) | ||
| shutdownCtx, cancel := context.WithTimeout(ctx, *builtinBackupMysqldDeadline) | ||
| err = params.Mysqld.Shutdown(shutdownCtx, params.Cnf, true) |
Contributor
Author
There was a problem hiding this comment.
I don't see an easy way to test this. I can't use fakemysqldaemon to create a mysqld that hangs on shutdown, because that package imports this package, which causes circular import errors. 🤔
Contributor
Author
There was a problem hiding this comment.
Solved this with blackbox testing ✅
added 3 commits
October 11, 2020 16:00
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
…behavior Signed-off-by: Andrew Mason <amason@slack-corp.com>
deepthi
reviewed
Oct 14, 2020
Collaborator
deepthi
left a comment
There was a problem hiding this comment.
Nice work! Just the one comment.
| ) | ||
|
|
||
| var ( | ||
| // BuiltinBackupMysqldDeadline is how long ExecuteBackup should wait for response from mysqld.Shutdown. |
Collaborator
There was a problem hiding this comment.
typically deadline is used for timestamps and timeout for durations. This looks like a timeout.
Signed-off-by: Andrew Mason <amason@slack-corp.com>
deepthi
approved these changes
Oct 20, 2020
Collaborator
|
@ajm188 would you please create another PR to merge this into release-8.0? |
ajm188
pushed a commit
to tinyspeck/vitess
that referenced
this pull request
Oct 22, 2020
…meout Add timeout for mysqld_shutdown Signed-off-by: Andrew Mason <amason@slack-corp.com>
deepthi
added a commit
that referenced
this pull request
Oct 22, 2020
Backport pull request #6849 (add timeout for mysqld_shutdown) to 8.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #6848
Notable changes:
ExecuteContextmethod. All hooks are now implemented withexec.CommandContextunder the hood instead ofexec.Command. Current callers are unaffected, and can opt in to switching over at their discretion.HookResult.ExitStatustype for hooks that exceed their context deadline/timeout.FakeMysqlDaemon.Start()andFakeMysqlDaemon.Shutdown()are configurable via theFakeMysqlDaemon.StartupTimeandFakeMysqlDaemon.ShutdownTimerespectively, to artificially cause delay in tests.