Explore the latest product updates and best practices at our hybrid Checkmk Conference #12 from June 16-18, 2026 – Register here

Werk #18746: Activate changes: post-snapshot-creation hook no longer fires twice on duplicate registration

Component Setup
Title Activate changes: post-snapshot-creation hook no longer fires twice on duplicate registration
Date Apr 28, 2026
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.4.0p29 Checkmk Community, Checkmk Pro, Checkmk Ultimate, Checkmk Cloud, Checkmk Ultimate MT

Previous Behavior

Previously, registering the same callable for the same hook name more than once (via cmk.gui.hooks.register, register_builtin, or register_from_plugin) caused that callable to be invoked once per registration whenever the hook fired.

Impact

This issue affected plug-ins (typically shipped via MKPs) whose registration code happened to be evaluated more than once during the GUI process startup, for example because the same plug-in file was loaded by more than one plug-in discovery mechanism. Plug-ins that registered hooks via register_builtin were particularly exposed, because builtin hooks survive unregister_plugin_hooks() and therefore accumulate across re-registrations. As a result, hooks such as post-snapshot-creation could end up running the custom handler twice on every "Activate changes", which consumed unnecessary CPU resources and produced duplicate side-effects.

New Behavior

Hook registration is now idempotent. When the same (hook name, callable) pair is registered more than once, it is safely collapsed into a single entry. Each hook now fires the handler exactly once per hooks.call(...).

To the list of all Werks