caishunfeng commented on code in PR #13752:
URL:
https://github.com/apache/dolphinscheduler/pull/13752#discussion_r1150294521
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/AbstractCommandExecutor.java:
##########
@@ -249,6 +261,22 @@ public TaskResponse run(String execCommand, TaskCallBack
taskCallBack) throws Ex
}
}
+ if (podLogOutputFuture != null) {
+ try {
+ // Wait kubernetes pod log collection finished
+ String msg = (String) podLogOutputFuture.get();
+ if (StringUtils.isEmpty(msg)) {
+ // delete pod after successful execution
+ ProcessUtils.cancelApplication(taskRequest);
+ } else {
+ // contains error message
+ logger.error(msg);
+ }
+ } catch (ExecutionException e) {
+ logger.info("Handle pod log error", e);
Review Comment:
```suggestion
logger.error("Handle pod log error", e);
```
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/AbstractCommandExecutor.java:
##########
@@ -249,6 +261,22 @@ public TaskResponse run(String execCommand, TaskCallBack
taskCallBack) throws Ex
}
}
+ if (podLogOutputFuture != null) {
+ try {
+ // Wait kubernetes pod log collection finished
+ String msg = (String) podLogOutputFuture.get();
+ if (StringUtils.isEmpty(msg)) {
+ // delete pod after successful execution
+ ProcessUtils.cancelApplication(taskRequest);
+ } else {
+ // contains error message
+ logger.error(msg);
Review Comment:
just error msg?
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/AbstractCommandExecutor.java:
##########
@@ -249,6 +261,22 @@ public TaskResponse run(String execCommand, TaskCallBack
taskCallBack) throws Ex
}
}
+ if (podLogOutputFuture != null) {
+ try {
+ // Wait kubernetes pod log collection finished
+ String msg = (String) podLogOutputFuture.get();
+ if (StringUtils.isEmpty(msg)) {
+ // delete pod after successful execution
+ ProcessUtils.cancelApplication(taskRequest);
Review Comment:
Why need to cancel when pod log output is empty? Does it necessarily mean
that the pod is finished?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]