diff --git a/contribs/src/main/java/com/netflix/conductor/contribs/asset/ReferenceKeysMatchAction.java b/contribs/src/main/java/com/netflix/conductor/contribs/asset/ReferenceKeysMatchAction.java index 6117eaf42d..8be5365c8d 100644 --- a/contribs/src/main/java/com/netflix/conductor/contribs/asset/ReferenceKeysMatchAction.java +++ b/contribs/src/main/java/com/netflix/conductor/contribs/asset/ReferenceKeysMatchAction.java @@ -62,14 +62,14 @@ public List handle(EventHandler.Action action, Object payload, EventExec } else { taskStatus = Task.Status.COMPLETED; } - + logger.debug("ReferenceKeysMatchAction: Task Status " + taskStatus); Map titleKeysMap = ScriptEvaluator.evaluateMap(params.titleKeys, payload); Map titleVersionMap = ScriptEvaluator.evaluateMap(params.titleVersion, payload); ReferenceKey eventRefKeys = new ReferenceKey(); eventRefKeys.titleKeys = mapper.convertValue(titleKeysMap, TitleKeys.class); eventRefKeys.titleVersion = mapper.convertValue(titleVersionMap, TitleVersion.class); - + logger.debug("ReferenceKeysMatchAction: Task titleKeysMap " + titleKeysMap); // Get the current logging context (owner) String ndcValue = NDC.peek(); @@ -82,7 +82,7 @@ public List handle(EventHandler.Action action, Object payload, EventExec } else { tasks = executor.getPendingSystemTasks(Wait.NAME); } - + logger.debug("ReferenceKeysMatchAction: List of tasks " + tasks); boolean taskNamesDefined = CollectionUtils.isNotEmpty(params.taskRefNames); tasks.parallelStream().forEach(task -> { boolean ndcCleanup = false; @@ -91,39 +91,41 @@ public List handle(EventHandler.Action action, Object payload, EventExec ndcCleanup = true; NDC.push(ndcValue); } + logger.debug("ReferenceKeysMatchAction: Check for referenceKeys"); if (!task.getInputData().containsKey("referenceKeys")) { return; } - + logger.debug("ReferenceKeysMatchAction: Check for taskNamesDefined"); if (taskNamesDefined && !params.taskRefNames.contains(task.getReferenceTaskName())) { return; } - + logger.debug("ReferenceKeysMatchAction: Check for Workflows"); Workflow workflow = executor.getWorkflow(task.getWorkflowInstanceId(), false); if (workflow == null) { - logger.debug("No workflow found with id " + task.getWorkflowInstanceId() + ", skipping " + task); + logger.debug("ReferenceKeysMatchAction: No workflow found with id " + task.getWorkflowInstanceId() + ", skipping " + task); return; } - + logger.debug("ReferenceKeysMatchAction: Check for isTeminal"); if (workflow.getStatus().isTerminal()) { return; } + logger.debug("ReferenceKeysMatchAction: Get taskReferenceKeys"); Object taskReferenceKeys = task.getInputData().get("referenceKeys"); if (taskReferenceKeys == null) { return; } if (!(taskReferenceKeys instanceof List)) { - logger.warn("Task input referenceKeys is not a list for " + task); + logger.warn("ReferenceKeysMatchAction: Task input referenceKeys is not a list for " + task); return; } List taskRefKeys = mapper.convertValue(taskReferenceKeys, new TypeReference>() { }); - + logger.debug("ReferenceKeysMatchAction: Perform Array Match"); // Array match if (!matches(taskRefKeys, eventRefKeys)) { return; } - + logger.debug("ReferenceKeysMatchAction: Update Task Status " + taskStatus); //Otherwise update the task as we found it task.setStatus(taskStatus); task.getOutputData().put("conductor.event.name", ee.getEvent()); @@ -330,6 +332,8 @@ private boolean matches(List taskRefKeys, ReferenceKey erk) { } private static boolean equals(String s1, String s2){ + boolean eval = "*".equals(s1) || Objects.equals(s1, s2); + logger.debug("Strings " + s1 + ", " + s2 + " = " + eval); return "*".equals(s1) || Objects.equals(s1, s2); } diff --git a/core/src/main/java/com/netflix/conductor/core/events/EventProcessor.java b/core/src/main/java/com/netflix/conductor/core/events/EventProcessor.java index 893938c29c..d50eef3083 100644 --- a/core/src/main/java/com/netflix/conductor/core/events/EventProcessor.java +++ b/core/src/main/java/com/netflix/conductor/core/events/EventProcessor.java @@ -299,6 +299,8 @@ private void handle(ObservableQueue queue, Message msg) { // see below when ack or unack decided if (retryEnabled) { boolean anyRunning = es.anyRunningWorkflowsByTags(tags); + logger.debug("Number of Running Workflows " + anyRunning); + if (!anyRunning) { logger.debug("Handler did not find running workflows with tags. Handler={}, tags={}", handler.getName(), tags); MetricService.getInstance()