VGalaxies commented on code in PR #2945:
URL: https://github.com/apache/hugegraph/pull/2945#discussion_r3471835421


##########
hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/controller/PartitionAPI.java:
##########
@@ -168,27 +171,40 @@ public Map<String, Object> 
dumpPartition(@PathVariable(value = "id") int id) thr
             }
             cfIterator.close();
         });
-        return okMap("ok", null);
+        return ok("ok", null);

Review Comment:
   **High: Null success payloads now throw**
   
   
`hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/controller/PartitionAPI.java:174`
   
   **Evidence**
   - `dumpPartition()` returns `ok("ok", null)` here and `cleanPartition()` 
does the same at line 189, while the new helper builds `Map.of("status", 200, 
k, v)` at line 238. Java `Map.of()` rejects null keys or values and throws 
`NullPointerException`.
   
   **Impact**
   - `GET /v1/partition/dump/{id}` and `GET /v1/partition/clean/{id}` can 
return HTTP 500 after the operation succeeds; for clean, the data may already 
have been modified before response construction fails.
   
   **Requested fix**
   - Build the response with a nullable map implementation such as 
`HashMap`/`LinkedHashMap`, or stop passing null values into `ok(...)`.



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