jtuglu-netflix commented on code in PR #18082:
URL: https://github.com/apache/druid/pull/18082#discussion_r2140571982


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java:
##########
@@ -226,7 +226,8 @@ public Response specGetAll(
                   if (includeFull) {
                     Optional<SupervisorSpec> theSpec = 
manager.getSupervisorSpec(x);
                     if (theSpec.isPresent()) {
-                      theBuilder.withSpec(manager.getSupervisorSpec(x).get());
+                      theBuilder.withSpec(theSpec.get())
+                          
.withDataSource(theSpec.get().getDataSources().get(0));

Review Comment:
   I don't know why it was ever created as a list(we don't have any supervisors 
AFAIK that operate on multiple). We rely on the assumption that it can't be 
null/empty elsewhere in the code(one example 
[here](https://github.com/apache/druid/blob/f776f33069d46c79fa6e41a7f7da755277a0360a/indexing-service/src/main/java/org/apache/druid/indexing/scheduledbatch/ScheduledBatchSupervisor.java#L54)),
 so I've gone off that.
   
   EDIT:
   As this should never happen, I've updated it to pass `null` to the builder 
method, which will then throw a `Precondition` violation check (so the 
exception is more obvious).



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