zuston commented on code in PR #1510:
URL:
https://github.com/apache/incubator-uniffle/pull/1510#discussion_r1481005843
##########
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:
> Considering this issue, here, we want to unregister all shuffles of the
app at the "current" moment, which means that if AppUnregisterPurgeEvent is
introduced, we need to pass all shuffleIds of the current moment into the
event. If so, why don't we just use ShufflePurgeEvent and pass the shuffleIds
into it.
I means we could remove app without rechecking the heartbeat timeout.

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