Skip to content

Commit

Permalink
Don't call ReconcileEngineState on an engine we are trying to stop
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Weber <eric.weber@suse.com>
(cherry picked from commit 57b4596)
  • Loading branch information
ejweber authored and David Ko committed Jul 5, 2023
1 parent 5ff67e8 commit ee45988
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion controller/engine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,10 @@ func (ec *EngineController) syncEngine(key string) (err error) {
// we allow across monitoring temporarily due to migration case
if !ec.isMonitoring(engine) {
ec.startMonitoring(engine)
} else if engine.Status.ReplicaModeMap != nil {
} else if engine.Status.ReplicaModeMap != nil && engine.Spec.DesireState != longhorn.InstanceStateStopped {
// If engine.Spec.DesireState == longhorn.InstanceStateStopped, we have likely already issued a command to
// shut down the engine. It is potentially dangerous to attempt to communicate with it now, as a new engine
// may start using its address.
if err := ec.ReconcileEngineState(engine); err != nil {
return err
}
Expand Down

0 comments on commit ee45988

Please sign in to comment.