-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
gitlab-runner service: add graceful termination #27222
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
Conversation
a6ce047
to
dae3112
Compare
description = '' | ||
Finish all remaining jobs before stopping, restarting or reconfiguring. | ||
If not set gitlab-runner will stop immediatly without waiting for jobs to finish, | ||
which will lead to faild builds. |
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.
Failed
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.
Fixed
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.
Also misses a comma after set.
default = "infinity"; | ||
type = types.string; | ||
example = "5min 20s"; | ||
description = ''Time to wait till a graceful shutdown is turned into a forceful one''; |
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.
until
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.
Fixed
dae3112
to
ced6c0f
Compare
@@ -15,6 +15,23 @@ in | |||
description = "Verbatim config.toml to use"; | |||
}; | |||
|
|||
graceful = mkOption { |
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.
Maybe rename gracefulRestart
? This sounds more informative to me.
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.
I tought about gracefulTermination
as well as this most accurately describes what it actually does.
The current behavior was for gitlab-runner is to immediately terminate when there was a restart required. This can lead to aborted builds and is annoying to users. By enabling graceful mode gitlab-runner will wait for all builds to finish before terminating. The disadvantage is that a nixos-rebuild switch needs to wait till all jobs are done. Because of that it is not enabled by default.
ced6c0f
to
3d9ea26
Compare
Motivation for this change
The current behavior was for gitlab-runner is to immediately terminate when there
was a restart required. This can lead to aborted builds and is annoying to users.
By enabling graceful mode gitlab-runner will wait for all builds to finish before
terminating. The disadvantage is that a nixos-rebuild switch needs to wait till
all jobs are done. Because of that it is not enabled by default.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)