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


##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java:
##########
@@ -132,11 +141,36 @@ public Task toTask(Job from) throws IOException
     Optional<EnvVar> taskJson = envVars.stream().filter(x -> 
"TASK_JSON".equals(x.getName())).findFirst();
     String contents = taskJson.map(envVar -> 
taskJson.get().getValue()).orElse(null);
     if (contents == null) {
-      throw new IOException("No TASK_JSON environment variable found in pod: " 
+ from.getMetadata().getName());
+      log.info("No TASK_JSON environment variable found in pod: %s. Trying to 
load task payload from deep storage.", from.getMetadata().getName());
+      return toTaskUsingDeepStorage(from);
     }
     return mapper.readValue(Base64Compression.decompressBase64(contents), 
Task.class);
   }
 
+  private Task toTaskUsingDeepStorage(Job from) throws IOException
+  {
+    com.google.common.base.Optional<InputStream> taskBody = 
taskLogs.streamTaskPayload(getTaskId(from).getOriginalTaskId());
+    if (!taskBody.isPresent()) {
+      throw InternalError.exception("Could not load task payload for job 
[%s]", from.getMetadata().getName());

Review Comment:
   updated the message



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to