-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement graceful shutdown * regenerate charts * add termination perdiod to smoke test * add docs * adapt changelog * fix import order * reorganize imports * improve commands * improve imports
- Loading branch information
1 parent
fbcfa95
commit 74d6910
Showing
10 changed files
with
120 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
21 changes: 17 additions & 4 deletions
21
docs/modules/superset/pages/usage-guide/operations/graceful-shutdown.adoc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
= Graceful shutdown | ||
|
||
Graceful shutdown of Superset nodes is either not supported by the product itself | ||
or we have not implemented it yet. | ||
You can configure the graceful shutdown as described in xref:concepts:operations/graceful_shutdown.adoc[]. | ||
|
||
Outstanding implementation work for the graceful shutdowns of all products where this functionality is relevant is tracked in | ||
https://github.com/stackabletech/issues/issues/357 | ||
== Nodes | ||
|
||
As a default, Superset nodes have `2 minutes` to shut down gracefully. | ||
|
||
The Superset node process will receive a `SIGTERM` signal when Kubernetes wants to terminate the Pod. | ||
It will log the received signal as shown in the log below and initiate a graceful shutdown. | ||
After the graceful shutdown timeout runs out, and the process still didn't exit, Kubernetes will issue a `SIGKILL` signal. | ||
|
||
[source,text] | ||
---- | ||
superset [2023-11-08 13:14:39 +0000] [206] [INFO] Handling signal: term | ||
metrics ts=2023-11-08T13:14:39.818Z caller=main.go:553 level=info msg="Received os signal, exiting" signal=terminated | ||
superset [2023-11-08 13:14:39 +0000] [207] [INFO] Worker exiting (pid: 207) | ||
superset Loaded your LOCAL configuration at [/stackable/app/pythonpath/superset_config.py] | ||
superset [2023-11-08 13:14:40 +0000] [206] [INFO] Shutting down: Master | ||
---- |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use snafu::{ResultExt, Snafu}; | ||
use stackable_operator::builder::PodBuilder; | ||
use stackable_superset_crd::SupersetConfig; | ||
|
||
#[derive(Debug, Snafu)] | ||
pub enum Error { | ||
#[snafu(display("Failed to set terminationGracePeriod"))] | ||
SetTerminationGracePeriod { | ||
source: stackable_operator::builder::pod::Error, | ||
}, | ||
} | ||
|
||
pub fn add_graceful_shutdown_config( | ||
merged_config: &SupersetConfig, | ||
pod_builder: &mut PodBuilder, | ||
) -> Result<(), Error> { | ||
// This must be always set by the merge mechanism, as we provide a default value, | ||
// users can not disable graceful shutdown. | ||
if let Some(graceful_shutdown_timeout) = merged_config.graceful_shutdown_timeout { | ||
pod_builder | ||
.termination_grace_period(&graceful_shutdown_timeout) | ||
.context(SetTerminationGracePeriodSnafu)?; | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub mod graceful_shutdown; | ||
pub mod pdb; |
This file contains 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
This file contains 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
This file contains 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