Option to override default signal and stop timeout #72
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.
let user override the default container termination signal and timeout
note that you can also specify system-wide defaults
Status Update 11/16
This pull request is incomplete and only works with the Drone exec command for local testing. It is not yet hooked up to the docker daemon, which would require patching the daemon environment variables [1] and then mapping those environment variables into the compiler [2]
It is also important to note and document that the default max stop timeout is zero, which means by default, no pipelines are able to configure a custom stop timeout or stop signal. First, one needs to set
DRONE_RUNNER_STOP_TIMEOUT_MAX=<duration>
which allows pipelines to set a custom stop value less than or equal to<duration>
This logic can be found in the below section of code that was added to the compiler. If no max timeout is set, the value is zero. This means any user-defined values will be greater than the max value (zero) and will be reset to zero. This is by design because we don't want people setting a custom stop timeout unless it has been explicitly enabled by the system admin.
[1] https://github.com/drone-runners/drone-runner-docker/blob/stop_signal/command/daemon/config.go#L44
[2] https://github.com/drone-runners/drone-runner-docker/blob/stop_signal/command/daemon/process.go#L76