Skip to content

[addon-operator] make module hook registration idempotent#797

Draft
Glitchy-Sheep wants to merge 1 commit into
mainfrom
fix/race-during-module-hooks-registration
Draft

[addon-operator] make module hook registration idempotent#797
Glitchy-Sheep wants to merge 1 commit into
mainfrom
fix/race-during-module-hooks-registration

Conversation

@Glitchy-Sheep

Copy link
Copy Markdown
Contributor

Overview

What this PR does / why we need it

Special notes for your reviewer

- AddHook replaces the previously registered hook object in all bindings
  instead of appending a duplicate: a stale entry keeps a nil
  HookController and crashes the kube-events dispatcher after a
  registration retry
- registered/controllersReady flags are read and written under the
  storage lock, giving a happens-before edge between setting hook
  controllers and observing the readiness flag
- RegisterHooks is serialized with a dedicated mutex so two concurrent
  ModuleRun tasks cannot register the same module twice
- getHooks sorts and returns a copy instead of the shared slice

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
@Glitchy-Sheep Glitchy-Sheep self-assigned this Jul 8, 2026
@Glitchy-Sheep Glitchy-Sheep added the bug Something isn't working label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant