Skip to content

Commit

Permalink
Added missing timeout to V2 bakery script; in V1 and V2, timeout is n…
Browse files Browse the repository at this point in the history
…ow 5s less than exec imterval. (closes #203)
  • Loading branch information
simonmeggle committed Jul 29, 2022
1 parent dea1c6a commit 9a893a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Fixed

* Bakery (V2): Added missing `timeout` to async robotmk execution. `timeout` is now
set to 5 sec less than the execution interval so that the agent can kill the runner
before the next execution. (#203)

## 1.2.9 - 2022-03-25

### Fixed
Expand Down
3 changes: 2 additions & 1 deletion bakery/v1/robotmk.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ def bake_robotmk(opsys, conf, conf_dir, plugins_dir):
if opsys == "windows":
# async mode in Windows: write configfile in INI-style, will be converted
# during installation to YML
timeout = int(config.global_dict['cache_time']) - 5
with Path(conf_dir, "check_mk.ini.plugins.robotmk-runner.py").open("w") as out:
out.write(u" execution robotmk-runner.py = async\r\n")
out.write(u" cache_age robotmk-runner.py = %d\r\n" % config.global_dict['execution_interval'])
# Kill the plugin before the next async execution will start
out.write(u" timeout robotmk-runner.py = %d\r\n" % config.global_dict['cache_time'])
out.write(u" timeout robotmk-runner.py = %d\r\n" % timeout)
out.write(u"\r\n")
plugins_dir_async = plugins_dir
elif opsys == "linux":
Expand Down
2 changes: 1 addition & 1 deletion bakery/v2/robotmk.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def runner_plugin(self, opsys: OS) -> Plugin:
return Plugin(
base_os=opsys,
source=Path('robotmk-runner.py'),
# TODO: interval=interval,
timeout=self.execution_interval - 5,
interval=self.execution_interval,
)
else:
Expand Down

0 comments on commit 9a893a7

Please sign in to comment.