Werk #13684: Agent Bakery: Minimize time locking the Checkmk configuration

Component Agent bakery
Title Agent Bakery: Minimize time locking the Checkmk configuration
Date Jun 13, 2022
Checkmk Editon Checkmk Enterprise (CEE)
Checkmk Version 2.2.0i1 2.1.0p3
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed

Previously, the agent bakery (or more precisely: The background job scheduling a call to the agent bakery) locked the Checkmk configuration for the entire baking time.

This caused some other operations that need access to the configuration, like sending notifications or changing global settings, to fail with the following error message:

Couldn't lock the Checkmk configuration. Another
process is running that holds this lock. In order for you to be
able to perform the desired action, you have to wait until the
other process has finished. Please try again later.

Instead of querying the Checkmk configuration multiple times, the agent bakery now gathers all needed configurations on startup while holding a lock, and releases it prior to invoking the more time consuming baking of agent packages.

To the list of all Werks