diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java index 330374779f62..d3426dfa3e6c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java @@ -379,9 +379,12 @@ public void deleteByWorkflowInstanceId(Integer workflowInstanceId) { return; } for (TaskInstance taskInstance : needToDeleteTaskInstances) { - ILogService iLogService = - SingletonJdkDynamicRpcClientProxyFactory.getProxyClient(taskInstance.getHost(), ILogService.class); - iLogService.removeTaskInstanceLog(taskInstance.getLogPath()); + if (StringUtils.isNotBlank(taskInstance.getLogPath())) { + ILogService iLogService = + SingletonJdkDynamicRpcClientProxyFactory.getProxyClient(taskInstance.getHost(), + ILogService.class); + iLogService.removeTaskInstanceLog(taskInstance.getLogPath()); + } } dqExecuteResultDao.deleteByWorkflowInstanceId(workflowInstanceId);