You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "georgew5656 (via GitHub)" <gi...@apache.org> on 2023/05/18 18:04:29 UTC

[GitHub] [druid] georgew5656 commented on a diff in pull request #14285: Fix log streaming

georgew5656 commented on code in PR #14285:
URL: https://github.com/apache/druid/pull/14285#discussion_r1198126384


##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesPeonLifecycle.java:
##########
@@ -265,14 +268,32 @@ private TaskStatus getTaskStatus(long duration)
     return taskStatus.withDuration(duration);
   }
 
-  private void saveLogs()
+  protected void startWatchingLogs()
+  {
+    if (logWatch != null) {
+      log.debug("There is already a log watcher for %s", taskId.getOriginalTaskId());
+      return;
+    }
+    try {
+      Optional<LogWatch> maybeLogWatch = kubernetesClient.getPeonLogWatcher(taskId);
+      if (maybeLogWatch.isPresent()) {

Review Comment:
   this method would only ever be called by one thread running join on that taskId. it's possible another thread (the one running shutdown commands) runs startWatchingLogs as well, but I don't think that would be an issue since logWatch would get set twice in succession which isn't too much of an issue



-- 
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@druid.apache.org

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


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