You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/09/14 23:17:52 UTC

[GitHub] [pinot] klsince commented on a diff in pull request #9400: set MDC so that one can route minion task logs to separate files cleanly

klsince commented on code in PR #9400:
URL: https://github.com/apache/pinot/pull/9400#discussion_r971375414


##########
pinot-minion/src/main/java/org/apache/pinot/minion/taskfactory/TaskFactoryRegistry.java:
##########
@@ -85,6 +89,11 @@ public TaskResult run() {
                   .addPhaseTiming(taskType, MinionQueryPhase.TASK_QUEUEING, jobDequeueTimeMs - jobInQueueTimeMs,
                       TimeUnit.MILLISECONDS);
               try {
+                if (separateTaskLogs) {
+                  LOGGER.info("Routing logs to separate file for task: {}", _taskConfig.getId());
+                  // Setting MDC so that logger can route task logs to a separate file.
+                  MDC.put("taskId", _taskConfig.getId());

Review Comment:
   good question, this will run on its own thread, as you see it's in a closure to be called later
   ```
   TaskFactory taskFactory = context -> {
   ```



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org