Copilot commented on code in PR #18315:
URL: https://github.com/apache/pinot/pull/18315#discussion_r3139540249
##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -181,12 +181,19 @@ export const RebalanceServerStatusOp = (
}}
data={{
records:
rebalanceServerJobs.map(rebalanceServerJob => {
- const progressStats =
JSON.parse(rebalanceServerJob.REBALANCE_PROGRESS_STATS);
+ const progressStats =
JSON.parse(rebalanceServerJob.REBALANCE_PROGRESS_STATS || '{}');
+ // Prefer the rebalance-reported start
time; fall back to the job submission time.
+ const startTimeMs =
progressStats.startTimeMs || +rebalanceServerJob.submissionTimeMs;
+ // timeToFinishInSeconds is only populated
once the rebalance completes.
+ const timeToFinishInSeconds =
progressStats.timeToFinishInSeconds || 0;
Review Comment:
`JSON.parse(rebalanceServerJob.REBALANCE_PROGRESS_STATS || '{}')` can still
throw if the stored progress stats string is malformed (not just null/empty).
In this component you already wrap the detail-view parses in a try/catch;
consider doing the same here (or using a shared safe-JSON-parse helper) so the
entire dialog doesn’t crash when one row has bad data, and fall back to an
empty progressStats object / placeholder status instead.
--
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]