From 62b5175f60425fb64c9295683def5d698778ecd1 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 27 Apr 2024 14:48:36 +0300 Subject: [PATCH] [#1110] node: Log maintenance stop only if it was enabled Signed-off-by: Evgenii Stratonikov --- cmd/frostfs-node/config.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/frostfs-node/config.go b/cmd/frostfs-node/config.go index c316e3824..2795936e5 100644 --- a/cmd/frostfs-node/config.go +++ b/cmd/frostfs-node/config.go @@ -381,8 +381,9 @@ func (c *cfg) startMaintenance() { // stops node's maintenance. func (c *internals) stopMaintenance() { - c.isMaintenance.Store(false) - c.log.Info(logs.FrostFSNodeStoppedLocalNodesMaintenance) + if c.isMaintenance.CompareAndSwap(true, false) { + c.log.Info(logs.FrostFSNodeStoppedLocalNodesMaintenance) + } } // IsMaintenance checks if storage node is under maintenance.