xiangfu0 commented on code in PR #20212:
URL: https://github.com/apache/pinot/pull/20212#discussion_r4560224419
##########
pinot-controller/src/main/resources/app/pages/TaskQueueTable.tsx:
##########
@@ -111,7 +111,10 @@ const TaskQueueTable = (props) => {
const handleScheduleNow = async () => {
const res = await PinotMethodUtils.scheduleTaskAction(tableName, taskType);
- if (get(res, `${taskType}`, null) === null) {
+ const scheduledTasks = get(res, `${taskType}`, null);
+ const hasErrors = !!get(res, 'generationErrors', null) || !!get(res,
'schedulingErrors', null);
+ // A task type that created no task is left out of the response; it is
only an error if an error is reported
+ if (hasErrors && !scheduledTasks) {
Review Comment:
**MAJOR: failed schedule requests now show as "No task to schedule".**
`baseApi` doesn't throw on HTTP errors: its error interceptor
(`axios-config.ts`, `getAxiosErrorInterceptor`) resolves with `error.response`.
So `res` here can be an error body like `{"code":500,"error":"Failed to
schedule tasks due to error: ... No tasks submitted due to [...]"}`. That body
has no `generationErrors` or `schedulingErrors`, so `hasErrors` is false and
the request falls through to the success toast.
The controller returns that 500 when every table fails generation
(`PinotTaskManager.scheduleTask`, around line 1036). That happens when the
generator throws, the disk-utilization limit is exceeded, or the table lock is
held by another controller. A 403 lands in the same branch. On master the UI
showed "Could not schedule task" for these; now it reports success. Reproduced
with axios 1.20.0 and lodash 4.18.1 using the same interceptor:
```
HTTP 500 {code,error} master UI: ERROR "Could not schedule task" this
PR: SUCCESS "No task to schedule"
HTTP 403 {code,error} master UI: ERROR "Could not schedule task" this
PR: SUCCESS "No task to schedule"
HTTP 200 no task, no errs master UI: ERROR this
PR: SUCCESS "No task to schedule" (intended fix, OK)
```
Suggested fix: only treat the response as "No task to schedule" when it's a
real schedule response. For example, `const isScheduleResponse = res &&
'generationErrors' in res && 'schedulingErrors' in res;`. Otherwise show the
error toast with `get(res, 'error')`.
---
*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]