YongGang commented on code in PR #14643:
URL: https://github.com/apache/druid/pull/14643#discussion_r1275229493
##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesTaskRunner.java:
##########
@@ -269,17 +260,17 @@ public Optional<InputStream> streamTaskReports(String
taskid) throws IOException
@Override
public List<Pair<Task, ListenableFuture<TaskStatus>>> restore()
{
- List<Pair<Task, ListenableFuture<TaskStatus>>> tasks = new ArrayList<>();
+ List<Pair<Task, ListenableFuture<TaskStatus>>> restoredTasks = new
ArrayList<>();
for (Job job : client.getPeonJobs()) {
try {
Task task = adapter.toTask(job);
- tasks.add(Pair.of(task, joinAsync(task)));
+ restoredTasks.add(Pair.of(task, runOrJoinTask(task, false)));
Review Comment:
Updated. My thinking was since we added synchronized block (or lock in the
previous commit), it's better to have a single place/method to have this
complexity. But agree this may make the code less readable.
--
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]