From b7ae172e17e1e10133df4e6f5e48af51830261a8 Mon Sep 17 00:00:00 2001 From: sangeetanadgir Date: Wed, 22 Nov 2023 15:25:50 +0530 Subject: [PATCH 1/3] ONECOND-2298-Improve logging to debug http task retry --- .../netflix/conductor/contribs/http/GenericHttpTask.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contribs/src/main/java/com/netflix/conductor/contribs/http/GenericHttpTask.java b/contribs/src/main/java/com/netflix/conductor/contribs/http/GenericHttpTask.java index 63e1fb0fc7..3513df10f8 100644 --- a/contribs/src/main/java/com/netflix/conductor/contribs/http/GenericHttpTask.java +++ b/contribs/src/main/java/com/netflix/conductor/contribs/http/GenericHttpTask.java @@ -191,7 +191,7 @@ HttpResponse httpCall(Input input, Task task, Workflow workflow, WorkflowExecuto response.headers = cr.getHeaders(); return response; } catch (UniformInterfaceException ex) { - logger.error(ex.getMessage(), ex); + logger.error("HTTP task failed for workflowId{}, taskId {}, taskRefname {}, url {}, errorMessage {}", workflow.getWorkflowId(), task.getTaskId(), task.getReferenceTaskName(), input.getUri(), ex.getMessage()); ClientResponse cr = ex.getResponse(); logger.error("Status Code: {}", cr.getStatus()); if (cr.getStatus() > 199 && cr.getStatus() < 300) { @@ -204,11 +204,11 @@ HttpResponse httpCall(Input input, Task task, Workflow workflow, WorkflowExecuto return response; } else { String reason = cr.getEntity(String.class); - logger.error(reason, ex); + logger.error("HTTP task failed for workflowId{}, taskId {}, taskRefname {}, url {}, errorMessage {}", workflow.getWorkflowId(), task.getTaskId(), task.getReferenceTaskName(), input.getUri(), ex.getMessage()); throw new Exception(reason); } } catch (Exception ex) { - logger.error(ex.getMessage(), ex); + logger.error("HTTP task failed for workflowId{}, taskId {}, taskRefname {}, url {}, errorMessage {}", workflow.getWorkflowId(), task.getTaskId(), task.getReferenceTaskName(), input.getUri(), ex.getMessage()); response.body = null; response.headers = null; response.statusCode = -1; From dc8d31c6f04e7dedc7a07d35c85568e5177df877 Mon Sep 17 00:00:00 2001 From: sangeetanadgir Date: Wed, 22 Nov 2023 15:27:50 +0530 Subject: [PATCH 2/3] ONECOND-2298 --- .../com/netflix/conductor/contribs/http/GenericHttpTask.java | 1 - 1 file changed, 1 deletion(-) diff --git a/contribs/src/main/java/com/netflix/conductor/contribs/http/GenericHttpTask.java b/contribs/src/main/java/com/netflix/conductor/contribs/http/GenericHttpTask.java index 3513df10f8..c1dd062c2e 100644 --- a/contribs/src/main/java/com/netflix/conductor/contribs/http/GenericHttpTask.java +++ b/contribs/src/main/java/com/netflix/conductor/contribs/http/GenericHttpTask.java @@ -204,7 +204,6 @@ HttpResponse httpCall(Input input, Task task, Workflow workflow, WorkflowExecuto return response; } else { String reason = cr.getEntity(String.class); - logger.error("HTTP task failed for workflowId{}, taskId {}, taskRefname {}, url {}, errorMessage {}", workflow.getWorkflowId(), task.getTaskId(), task.getReferenceTaskName(), input.getUri(), ex.getMessage()); throw new Exception(reason); } } catch (Exception ex) { From 758648ad60e6486d66b27cce3405147b3c8d6d1a Mon Sep 17 00:00:00 2001 From: pradeeppalat01 Date: Mon, 29 Jan 2024 11:28:06 -0800 Subject: [PATCH 3/3] ONECOND-2310 --- .../com/netflix/conductor/core/execution/WorkflowSweeper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/netflix/conductor/core/execution/WorkflowSweeper.java b/core/src/main/java/com/netflix/conductor/core/execution/WorkflowSweeper.java index 076fec2d81..b70c2d4b86 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/WorkflowSweeper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/WorkflowSweeper.java @@ -115,7 +115,9 @@ public void sweep(List workflowIds, WorkflowExecutor executor) throws Ex Future future = es.submit(() -> { NDC.push("sweep-" + UUID.randomUUID().toString()); - logger.debug("Calling decider from sweeper for workflow {}", workflowId); + if (logger.isDebugEnabled()) { + logger.debug("Calling decider from sweeper for workflow {}", workflowId); + } try { WorkflowContext ctx = new WorkflowContext(config.getAppId());