Skip to content

[addon-operator] create module hook queues regardless of DoModuleStartup - #825

Draft
Fkuloff wants to merge 2 commits into
mainfrom
fix/module-hook-queues-without-startup
Draft

[addon-operator] create module hook queues regardless of DoModuleStartup#825
Fkuloff wants to merge 2 commits into
mainfrom
fix/module-hook-queues-without-startup

Conversation

@Fkuloff

@Fkuloff Fkuloff commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Overview

The Startup phase of ModuleRun no longer branches on hm.DoModuleStartup: a module in that phase always has its hook queues created and its onStartup hooks executed.

What this PR does / why we need it

modules.Startup is set only in the BasicModule constructor and in ResetState, so a module in that phase has not completed its startup. DoModuleStartup duplicates that state and every ModuleRun producer computes it independently: converge sets it only for modules in ModulesToEnable (converge-modules/task.go:155), functional.Scheduler.Add replaces a stored request wholesale, and PushRunModuleTask never sets it.

A module that took such a task created no hook queues and ran no onStartup hooks, and got neither back because modules.Startup is not re-entered. Its Synchronization tasks were dropped, the empty SynchronizationState reported IsCompleted() == true, and the chart was applied without the values those hooks were to fill.

Special notes for your reviewer

Supersedes #740, which fixes the same root cause at three producer sites; the consumer-side fix also covers PushRunModuleTask and CreateReloadModulesTasks. The re-ensure call #797 added to QueueSynchronizationTasks is kept as a second line of defence.

Signed-off-by: Artem Kuleshov <artem.kuleshov@flant.com>
Signed-off-by: Artem Kuleshov <artem.kuleshov@flant.com>
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