Skip to content

Commit

Permalink
remove server inactive statusCode
Browse files Browse the repository at this point in the history
  • Loading branch information
zuston committed May 11, 2024
1 parent 15363bd commit 015ab6c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public enum StatusCode {
ACCESS_DENIED(8),
INVALID_REQUEST(9),
NO_BUFFER_FOR_HUGE_PARTITION(10),
SERVER_INACTIVE(11),
UNKNOWN(-1);

static final Map<Integer, StatusCode> VALUE_MAP =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void updateSparkConfCustomer(SparkConf sparkConf) {
(ShuffleServerGrpcService)
((GrpcServer) shuffleServer.getServer()).getServicesWithInterceptors().get(0).getKey();
ShuffleServer spy = spy(shuffleServer);
when(spy.isActivateClientPartitionReassign()).thenReturn(true);
when(spy.isActivateClientReassign()).thenReturn(true);
grpcServer.setShuffleServer(spy);
}
}
1 change: 0 additions & 1 deletion proto/src/main/proto/Rss.proto
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ enum StatusCode {
ACCESS_DENIED = 8;
INVALID_REQUEST = 9;
NO_BUFFER_FOR_HUGE_PARTITION = 10;
SERVER_INACTIVE = 11;
// add more status
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ public void sendHeartbeat() {
shuffleServer.getNettyPort());
}

public boolean isActivateClientPartitionReassign() {
public boolean isActivateClientReassign() {
if (decommissionActivateClientReassignEnabled && serverStatus.get() != ServerStatus.ACTIVE) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,17 @@ public void finishShuffle(
public void requireBuffer(
RequireBufferRequest request, StreamObserver<RequireBufferResponse> responseObserver) {
String appId = request.getAppId();
if (shuffleServer.isActivateClientPartitionReassign()
if (shuffleServer.isActivateClientReassign()
&& shuffleServer
.getShuffleTaskManager()
.getShuffleTaskInfo(appId)
.isBlockFailureReassignEnabled()) {
responseObserver.onNext(
RequireBufferResponse.newBuilder()
.setStatus(StatusCode.SERVER_INACTIVE.toProto())
.setRetMsg("Server is inactive, status: " + shuffleServer.getServerStatus())
.setStatus(StatusCode.ACCESS_DENIED.toProto())
.setRetMsg(
"Access is denied that server is inactive, status: "
+ shuffleServer.getServerStatus())
.build());
responseObserver.onCompleted();
return;
Expand Down

0 comments on commit 015ab6c

Please sign in to comment.