rickchengx commented on code in PR #13332:
URL:
https://github.com/apache/dolphinscheduler/pull/13332#discussion_r1067640691
##########
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/runner/WorkerTaskExecuteRunnable.java:
##########
@@ -279,6 +284,25 @@ protected void sendTaskResult() {
taskExecutionContext.getCurrentExecutionStatus());
}
+ protected void sendRemoteLogIfNeeded() {
+ if
("true".equalsIgnoreCase(PropertyUtils.getString(Constants.REMOTE_LOGGING_ENABLE)))
{
+ try {
+ logger.info("Start to send log {} to remote target {}",
taskExecutionContext.getLogPath(),
+
PropertyUtils.getString(Constants.REMOTE_LOGGING_TARGET));
+ logger.info("Wait log {} to be flushed...",
taskExecutionContext.getLogPath());
+ Thread.sleep(5000);
Review Comment:
> If you trigger `sendRemoteLogIfNeeded` in `afterExecute`, it does have to
sleep for a few seconds, because when handling large amount of logs, async
flush will take a lot of time.
>
> So, I recommend you trigger in `logHandle` when handling
`FINALIZE_SESSION_MARKER` which marks that log appender will be closed in few
seconds, flush logic in ds(you can check in `parseProcessOutput`) makes sure
that no logs will reach in these few seconds and we don't have to wait for five
seconds any more.
Hi, @Radeity Thanks a lot for your suggestion! I think this is a good idea
and I'll look into it.
--
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]