LourierL commented on code in PR #17523:
URL:
https://github.com/apache/dolphinscheduler/pull/17523#discussion_r2365648579
##########
dolphinscheduler-task-executor/src/main/java/org/apache/dolphinscheduler/task/executor/container/AbstractTaskExecutorContainer.java:
##########
@@ -145,4 +150,26 @@ private void pushTaskExecutorLogToRemote(final
ITaskExecutor taskExecutor) {
}
}
+ /**
+ * Delete task exec Directory if set development.state=false in
common.properties explicit
+ * otherwise keep it for debug reason.
+ */
+ private void deleteExecPathIfProduction(ITaskExecutor taskExecutor) {
+ boolean isDev = PropertyUtils.getBoolean(Constants.DEVELOPMENT_STATE,
true);
+ if (!isDev) {
+ try {
+ final TaskExecutionContext ctx =
taskExecutor.getTaskExecutionContext();
+ final String execPath = ctx.getExecutePath();
+ if (StringUtils.isNotEmpty(execPath)) {
+ FileUtils.deleteFile(execPath);
+ log.info("Deleted task exec directory: {}", execPath);
+ }
+ } catch (Exception e) {
+ log.warn("Failed to delete task exec directory in prod mode.",
e);
+ }
+ } else {
+ log.debug("Development mode is on, skip deleting executePath for
debug reason");
+ }
+ }
Review Comment:
ok, I understand that will be better. I will invoke the
clearTaskInstanceWorkingDirectory() in PhysicalTaskExecutor and do nothing in
LogicTaskExecutor. Is that OK?
--
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]