CalvinKirs commented on a change in pull request #4618:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/4618#discussion_r578115763



##########
File path: 
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
##########
@@ -336,32 +338,50 @@ private void clear() {
      */
     private void parseProcessOutput(Process process) {
         String threadLoggerInfoName = 
String.format(LoggerUtils.TASK_LOGGER_THREAD_NAME + "-%s", 
taskExecutionContext.getTaskAppId());
-        ExecutorService parseProcessOutputExecutorService = 
ThreadUtils.newDaemonSingleThreadExecutor(threadLoggerInfoName);
-        parseProcessOutputExecutorService.submit(new Runnable() {
+        ExecutorService getOutputLogService = 
ThreadUtils.newDaemonSingleThreadExecutor(threadLoggerInfoName + "-" + 
"getOutputLogService");
+        getOutputLogService.submit(new Runnable() {

Review comment:
       ` parseProcessOutputExecutorService.submit(() -> {
               BufferedReader inReader = null;
   
               try {
                   inReader = new BufferedReader(new 
InputStreamReader(process.getInputStream()));
                   String line;
   
                   long lastFlushTime = System.currentTimeMillis();
   
                   while ((line = inReader.readLine()) != null) {
                       if (line.startsWith("${setValue(")) {
                           
varPool.append(line.substring("${setValue(".length(), line.length() - 2));
                           varPool.append("$VarPool$");
                       } else {
                           logBuffer.add(line);
                           lastFlushTime = flush(lastFlushTime);
                       }
                   }
               } catch (Exception e) {
                   logger.error(e.getMessage(), e);
               } finally {
                   clear();
                   close(inReader);
               }
           });`




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to