zuston commented on code in PR #1393:
URL: 
https://github.com/apache/incubator-uniffle/pull/1393#discussion_r1437573400


##########
server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java:
##########
@@ -458,31 +459,37 @@ public long requireBuffer(
       String appId, int shuffleId, List<Integer> partitionIds, int 
requireSize) {
     ShuffleTaskInfo shuffleTaskInfo = shuffleTaskInfos.get(appId);
     if (null == shuffleTaskInfo) {
-      return RequireBufferStatusCode.NO_REGISTER.statusCode();
+      LOG.error("Find not registered app, appId: {}, shuffleId: {}", appId, 
shuffleId);
+      throw new NoRegisterException("Not Registered, appId: " + appId);
     }
     for (int partitionId : partitionIds) {
       long partitionUsedDataSize = getPartitionDataSize(appId, shuffleId, 
partitionId);
       if (shuffleBufferManager.limitHugePartition(
           appId, shuffleId, partitionId, partitionUsedDataSize)) {
         
ShuffleServerMetrics.counterTotalRequireBufferFailedForHugePartition.inc();
-        return RequireBufferStatusCode.NO_BUFFER.statusCode();
+        String errorMessage =

Review Comment:
   Why not throwing the `NoBufferForHugePartitionException` ? 



##########
server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java:
##########
@@ -458,31 +459,37 @@ public long requireBuffer(
       String appId, int shuffleId, List<Integer> partitionIds, int 
requireSize) {
     ShuffleTaskInfo shuffleTaskInfo = shuffleTaskInfos.get(appId);
     if (null == shuffleTaskInfo) {
-      return RequireBufferStatusCode.NO_REGISTER.statusCode();
+      LOG.error("Find not registered app, appId: {}, shuffleId: {}", appId, 
shuffleId);

Review Comment:
   How about `no such app is registered. appId: {}, shuffleId: {}`



##########
server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java:
##########
@@ -458,31 +459,37 @@ public long requireBuffer(
       String appId, int shuffleId, List<Integer> partitionIds, int 
requireSize) {
     ShuffleTaskInfo shuffleTaskInfo = shuffleTaskInfos.get(appId);
     if (null == shuffleTaskInfo) {
-      return RequireBufferStatusCode.NO_REGISTER.statusCode();
+      LOG.error("Find not registered app, appId: {}, shuffleId: {}", appId, 
shuffleId);
+      throw new NoRegisterException("Not Registered, appId: " + appId);
     }
     for (int partitionId : partitionIds) {
       long partitionUsedDataSize = getPartitionDataSize(appId, shuffleId, 
partitionId);
       if (shuffleBufferManager.limitHugePartition(
           appId, shuffleId, partitionId, partitionUsedDataSize)) {
         
ShuffleServerMetrics.counterTotalRequireBufferFailedForHugePartition.inc();
-        return RequireBufferStatusCode.NO_BUFFER.statusCode();
+        String errorMessage =
+            String.format(
+                "No Buffer For Huge Partition, appId: %s, shuffleId: %s, 
partitionIds: %s, partitionUsedDataSize: %s",

Review Comment:
   How about `Huge partition is limited to writing. appId: %s, shuffleId: %s, 
partitionIds: %s, partitionUsedDataSize: %s` ? 



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