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


##########
server/src/main/java/org/apache/uniffle/server/ShuffleServerGrpcService.java:
##########
@@ -99,6 +102,37 @@ public ShuffleServerGrpcService(ShuffleServer 
shuffleServer) {
     this.shuffleServer = shuffleServer;
   }
 
+  @Override
+  public void unregisterApp(
+      RssProtos.AppUnregisterRequest request,
+      StreamObserver<RssProtos.AppUnregisterResponse> responseStreamObserver) {
+    String appId = request.getAppId();
+
+    StatusCode result = StatusCode.SUCCESS;
+    String responseMessage = "OK";
+    try {
+      Map<Integer, RangeMap<Integer, ShuffleBuffer>> shuffleIdToBuffers =
+          shuffleServer.getShuffleBufferManager().getBufferPool().get(appId);
+      if (shuffleIdToBuffers != null) {
+        HashSet<Integer> shuffleIds = 
Sets.newHashSet(shuffleIdToBuffers.keySet());
+        shuffleIds.forEach(
+            shuffleId ->
+                
shuffleServer.getShuffleTaskManager().removeShuffleDataAsync(appId, shuffleId));

Review Comment:
   We should preserve these logic that solved the bug of #1212 . 
   
   How about introducing new event named AppUnregisterPurgeEvent? 



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