bitflicker64 commented on code in PR #3233:
URL: https://github.com/apache/hugegraph/pull/3233#discussion_r4085978616


##########
hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/TaskAPI.java:
##########
@@ -89,9 +89,16 @@ public String splitPartitions() {
         }
     }
 
-    @GetMapping(value = "/balanceLeaders")
-    public Map<Integer, Long> balanceLeaders() throws PDException {
-        return pdRestService.balancePartitionLeader();
+    @GetMapping(value = "/balanceLeaders", produces = 
MediaType.APPLICATION_JSON_VALUE)
+    @ResponseBody
+    public String balanceLeaders() {

Review Comment:
   Minor: `StoreAPI` exposes the same operation at `GET /v1/balanceLeaders` 
(StoreAPI.java:153-156, class mapping `/v1`). It still declares `throws 
PDException` with no handler and calls the same 
`pdRestService.balancePartitionLeader()`, and hugegraph-pd has no 
`@ExceptionHandler` or `@ControllerAdvice`. Inside the balance-shard window 
that route still answers the bare Spring 500 this PR removes from 
`/v1/task/balanceLeaders`, and the reason again reaches only the PD log.
   
   Please apply the same try/catch and `toJSON(e)` to 
`StoreAPI.balanceLeaders`, or say in the PR description that the 
`/v1/balanceLeaders` route is left for a follow-up in #3231.



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