Skip to content

Commit

Permalink
WX-1341 Better logging when a runner stops picking up new workflows (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jgainerdewar authored Nov 3, 2023
1 parent 74de9e3 commit 110ca3e
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,16 @@ class WorkflowManagerActor(params: WorkflowManagerActorParams)
params.jobExecutionTokenDispenserActor ! FetchLimitedGroups
stay()
case Event(ReplyLimitedGroups(groups), stateData) =>
val wfCount = stateData.workflows.size
val swfCount = stateData.subWorkflows.size
val maxNewWorkflows = maxWorkflowsToLaunch min (maxWorkflowsRunning - wfCount - swfCount)
val fetchCountLog = s"Fetching $maxNewWorkflows new workflows ($wfCount workflows and $swfCount subworkflows in flight)"
if (groups.nonEmpty)
log.info(s"Excluding groups from workflow launch: ${groups.mkString(", ")}")
log.info(s"${fetchCountLog}, excluding groups: ${groups.mkString(", ")}")
else if (maxNewWorkflows < 1)
log.info(s"${fetchCountLog}, no groups excluded from workflow launch.")
else
log.debug("No groups excluded from workflow launch.")
val maxNewWorkflows = maxWorkflowsToLaunch min (maxWorkflowsRunning - stateData.workflows.size - stateData.subWorkflows.size)
log.debug(s"${fetchCountLog}, no groups excluded from workflow launch.")
params.workflowStore ! WorkflowStoreActor.FetchRunnableWorkflows(maxNewWorkflows, excludedGroups = groups)
stay()
case Event(WorkflowStoreEngineActor.NoNewWorkflowsToStart, _) =>
Expand Down

0 comments on commit 110ca3e

Please sign in to comment.