-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cli: fix cockroach quit
#26158
cli: fix cockroach quit
#26158
Conversation
Review status: all files reviewed at latest revision, all discussions resolved, all commit checks successful. pkg/cli/start.go, line 1075 at r1 (raw file):
Could you extract this string constant so that it's shared with the other use? As is, it will rot too easily. pkg/cli/start.go, line 1078 at r1 (raw file):
Perhaps also mention that we don't fold this into Comments from Reviewable |
This patch fixes the following: - the logic in `doShutdown()` aims to ignore errors caused by attempts connect to a server which is closing its gRPC channels, but was missing one case of such errors: during the initial check whether the node was running. This patch causes gRPC "closed connection" errors to become also ignored in that case. - previously if there was a transient gRPC error during a hard shutdown whereby the shutdown could still succeed, then `cockroach quit` would fail no matter what. This patch makes `cockroach quit` retry a hard shutdown. - the warning messages are now emitted on stderr (via `log.Warningf`) instead of stdout. Release note (bug fix): fix a bug where `cockroach quit` would erroneously fail even though the node already successfully shut down. Release note (cli change): `cockroach quit` now emits warning message on its standard error stream, not standard output.
Review status: 0 of 1 files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/cli/start.go, line 1075 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
I made a mistake -- this string is not generated by the server. Solved the problem in a different way (retry hard shutdown). pkg/cli/start.go, line 1078 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
n/a. Comments from Reviewable |
bors r+ |
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks pending. Comments from Reviewable |
Build failed |
bors failed on #26098, retrying bors r+ |
bors r- |
Canceled |
(bors was stuck) bors r+ |
Timed out |
bors r+ |
Timed out (retrying...) |
@@ -1045,6 +1045,9 @@ func doShutdown(ctx context.Context, c serverpb.AdminClient, onModes []int32) er | |||
// out, or perhaps drops the connection while waiting). To that end, we first | |||
// run a noop DrainRequest. If that fails, we give up. | |||
if err := checkNodeRunning(ctx, c); err != nil { | |||
if grpcutil.IsClosedConnection(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
answered to ben there. if the server does not exist the thing still fails.
bors r- |
bors r+ |
internal bors weirdness, retrying bors r=knz |
Build failed (retrying...) |
26143: opt: Enable additional logic tests for opt configs r=andy-kimball a=andy-kimball Enable more logic tests (orms -> snapshot_unrelated_update). Fix various bugs and issues that were failing tests. 26158: cli: fix `cockroach quit` r=knz a=knz Informs/fixes #25870. Fixes #26144. This patch fixes the following: - the logic in `doShutdown()` aims to ignore errors caused by attempts connect to a server which is closing its gRPC channels, but was missing one case of such errors: during the initial check whether the node was running. This patch causes gRPC "closed connection" errors to become also ignored in that case. - previously if there was a transient gRPC error during a hard shutdown whereby the shutdown could still succeed, then `cockroach quit` would fail no matter what. This patch makes `cockroach quit` retry a hard shutdown. - the warning messages are now emitted on stderr (via `log.Warningf`) instead of stdout. Release note (bug fix): fix a bug where `cockroach quit` would erroneously fail even though the node already successfully shut down. Release note (cli change): `cockroach quit` now emits warning message on its standard error stream, not standard output. 26165: roachtest: enable periodic heap prof output for kv/splits/nodes=3 r=tschottdorf a=petermattis See #26081 Release note: None 26167: encryption: add cli command `cockroach gen encryption-key` r=windchan7 a=windchan7 Added cli command `cockroach gen encryption-key` to generate store keys for encryption at rest. Encryption CLI: #19783. Release note: None Co-authored-by: Andrew Kimball <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Peter Mattis <[email protected]> Co-authored-by: Victor Chen <[email protected]>
Build succeeded |
26163: release-2.0: cli: fix `cockroach quit` r=knz a=knz Backport 1/1 commits from #26158. This `cockroach quit` bug is likely to affect production users, so we need to back-port it. /cc @cockroachdb/release Co-authored-by: Raphael 'kena' Poss <[email protected]>
Informs/fixes #25870.
Fixes #26144.
This patch fixes the following:
the logic in
doShutdown()
aims to ignore errors caused by attemptsconnect to a server which is closing its gRPC channels, but was
missing one case of such errors: during the initial check whether
the node was running. This patch causes gRPC "closed connection"
errors to become also ignored in that case.
previously if there was a transient gRPC error during a hard
shutdown whereby the shutdown could still succeed, then
cockroach quit
would fail no matter what. This patch makescockroach quit
retry a hard shutdown.
the warning messages are now emitted on stderr (via
log.Warningf
)instead of stdout.
Release note (bug fix): fix a bug where
cockroach quit
woulderroneously fail even though the node already successfully shut down.
Release note (cli change):
cockroach quit
now emits warning messageon its standard error stream, not standard output.