xiangfu0 commented on code in PR #20212:
URL: https://github.com/apache/pinot/pull/20212#discussion_r4534250438


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTaskRestletResource.java:
##########
@@ -850,8 +851,11 @@ public void scheduleTasks(
       }
       Map<String, TaskSchedulingInfo> allTaskInfos = 
_pinotTaskManager.scheduleTasks(context);
       allTaskInfos.forEach((key, value) -> {
-        if (value.getScheduledTaskNames() != null) {
-          response.put(key, String.join(",", value.getScheduledTaskNames()));
+        // A generator that ran but created no task has an empty list: leave 
the task type out rather than return an
+        // empty task name, which callers would then poll as a task and fail on
+        List<String> scheduledTaskNames = value.getScheduledTaskNames();
+        if (scheduledTaskNames != null && !scheduledTaskNames.isEmpty()) {

Review Comment:
   **MAJOR: the controller UI still relies on the empty string this removes.** 
`pinot-controller/src/main/resources/app/pages/TaskQueueTable.tsx:114-137` 
(`handleScheduleNow`, the Task Queue "Schedule now" button) reads the response 
like this:
   - `res[taskType] === ''` shows the success toast "No task to schedule".
   - a missing `res[taskType]` shows the error toast "Could not schedule task".
   
   So after this change, clicking "Schedule now" when the generator has nothing 
to do shows the error toast, with empty generation and scheduling errors. Today 
it shows "No task to schedule". I reproduced this with lodash `get` on the two 
response shapes:
   
   ```
   base: {"MergeRollupTask":"", generationErrors:"", schedulingErrors:""} -> 
SUCCESS "No task to schedule"
   PR:   {generationErrors:"", schedulingErrors:""}                       -> 
ERROR   "Could not schedule task"
   ```
   
   The PR description says the bundled clients need no change, but this one 
does. Suggested fix: update `TaskQueueTable.tsx` in this PR so that a missing 
task type with empty `generationErrors` and `schedulingErrors` counts as "No 
task to schedule". It still counts as an error when either error string is 
non-empty. Separately, the API now leaves out task types it used to return with 
`""`, so external scripts that check for `""` will also change behavior. A 
release note, or the `backward-incompat` label, would help users notice.
   
   ---
   *AI-generated review via IntentLab ยท Model: Claude Opus 5.5 
(claude-opus-5-5).*



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