Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop using temporary files when writing sections
On some Linux distributions such Fedora and openSUSE, `$TMPDIR` points to a tmpfs file system. This is problematic because `tempfile::NamedTempFile::persists` does not work across file systems. Originally, we introduced temporary files to avoid race conditions between the scheduler writing a result and the agent plugin reading the results. However, in the meantime, we also introduced explicit locking, so this is not an issue anymore. Note that we still first attempt to write to `{result_path}.tmp` and then rename the file. This avoids breaking earlier, valid result files due to a failure during the write operation. In case the write operation failes, we attempt to remove `{result_path}.tmp`. However, leaving an invalid file behind won't break the agent plugin, since it ignores invalid files. CMK-18766
- Loading branch information