Skip to content

Commit

Permalink
Merge pull request #12142 from hassan11196/fix-frequent-agent-drain-m…
Browse files Browse the repository at this point in the history
…ode-alerts

Fix frequent agent drain mode alerts
  • Loading branch information
amaltaro authored Oct 15, 2024
2 parents 7001caf + 72fb5e5 commit 33d304f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/python/WMCore/Services/ReqMgrAux/ReqMgrAux.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,10 @@ def listDiskUsageOverThreshold(config, updateDB):

if updateDB and not t0Flag:
agentDrainMode = bool(len(overThresholdDisks))
if agentConfig and (agentDrainMode != agentConfig["AgentDrainMode"]):
reqMgrAux.updateWMAgentConfig(config.Agent.hostName, {"AgentDrainMode": agentDrainMode},
inPlace=True)
if agentConfig and (agentDrainMode != agentConfig.get("AgentDrainMode")):
if agentConfig.get("UserDrainMode") is True:
logging.info("Agent is already in UserDrainMode: True mode. No need to update.")
else:
reqMgrAux.updateWMAgentConfig(config.Agent.hostName, {"AgentDrainMode": agentDrainMode}, inPlace=True)

return overThresholdDisks

0 comments on commit 33d304f

Please sign in to comment.