From fb9ad6b5df81896b0624cef8eefc1334f6f2adbe Mon Sep 17 00:00:00 2001 From: Chris Marchesi Date: Fri, 30 Jul 2021 14:14:15 -0700 Subject: [PATCH 1/5] server: Add back controller shutdown on worker startup failure This adds back the controller shutdown call on worker failure. This was added in a15961e4 to address a panic discovered in testing, and was mistakenly thought to be unnecessary. This, however, covers multi-role scenarios where we have already started the controller, which needs to be shut down gracefully if possible if we can't start the worker. A nil check has been added to ensure the panic does not resurface. --- internal/cmd/commands/server/server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/cmd/commands/server/server.go b/internal/cmd/commands/server/server.go index 29cf554caa..8ea04e033b 100644 --- a/internal/cmd/commands/server/server.go +++ b/internal/cmd/commands/server/server.go @@ -463,6 +463,11 @@ func (c *Command) Run(args []string) int { if c.Config.Worker != nil { if err := c.StartWorker(); err != nil { c.UI.Error(err.Error()) + if c.controller != nil { + if err := c.controller.Shutdown(false); err != nil { + c.UI.Error(fmt.Errorf("Error with controller shutdown: %w", err).Error()) + } + } return base.CommandCliError } } From b81131039322b7cf081366a53a576ae9eb7bb002 Mon Sep 17 00:00:00 2001 From: Chris Marchesi Date: Fri, 30 Jul 2021 14:23:34 -0700 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95fa043060..d983e82b40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,7 +99,9 @@ Canonical reference for changes, improvements, and bugfixes for Boundary. well as the error message) ([issue](https://github.com/hashicorp/boundary/issues/1305), [PR](https://github.com/hashicorp/boundary/pull/1384)) - +* server: Fixed a regression in 0.4.0 that caused the controller to not shut + down on a multi-role server when there were issues starting the worker role. + ([PR](https://github.com/hashicorp/boundary/pull/1432)) ### New and Improved * docker: Add support for muti-arch docker images (amd64/arm64) via Docker buildx From 95876e72ca03c99dd869433c153da466961763f4 Mon Sep 17 00:00:00 2001 From: Chris Marchesi Date: Fri, 30 Jul 2021 14:49:27 -0700 Subject: [PATCH 3/5] Another update to CHANGELOG.md --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d983e82b40..eca13050ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,9 +99,10 @@ Canonical reference for changes, improvements, and bugfixes for Boundary. well as the error message) ([issue](https://github.com/hashicorp/boundary/issues/1305), [PR](https://github.com/hashicorp/boundary/pull/1384)) -* server: Fixed a regression in 0.4.0 that caused the controller to not shut - down on a multi-role server when there were issues starting the worker role. +* server: Fixed a bug in 0.4.0 that caused a panic on worker startup failure + when the server was not configured with a controller role. ([PR](https://github.com/hashicorp/boundary/pull/1432)) + ### New and Improved * docker: Add support for muti-arch docker images (amd64/arm64) via Docker buildx From 0b05e80afa6b4301b5103d1a0ed98e5e71ddef2a Mon Sep 17 00:00:00 2001 From: Chris Marchesi Date: Fri, 30 Jul 2021 16:01:05 -0700 Subject: [PATCH 4/5] Strike CHANGELOG entry --- CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eca13050ae..95fa043060 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,9 +99,6 @@ Canonical reference for changes, improvements, and bugfixes for Boundary. well as the error message) ([issue](https://github.com/hashicorp/boundary/issues/1305), [PR](https://github.com/hashicorp/boundary/pull/1384)) -* server: Fixed a bug in 0.4.0 that caused a panic on worker startup failure - when the server was not configured with a controller role. - ([PR](https://github.com/hashicorp/boundary/pull/1432)) ### New and Improved From c7a9d880b81cacfdb6eb00619ce36631cb9a1a60 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 2 Aug 2021 12:35:34 -0400 Subject: [PATCH 5/5] Fix changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95fa043060..29b98b4b28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,9 @@ Canonical reference for changes, improvements, and bugfixes for Boundary. well as the error message) ([issue](https://github.com/hashicorp/boundary/issues/1305), [PR](https://github.com/hashicorp/boundary/pull/1384)) +* server: Fix panic on worker startup failure when the server was not also + configured as a controller + ([PR](https://github.com/hashicorp/boundary/pull/1432)) ### New and Improved