Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RATIS-1497. Avoid using ForkJoinPool.commonPool() in GrpcClientProtocolService #587

Merged
merged 4 commits into from Jan 23, 2022

Conversation

szetszwo
Copy link
Contributor

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @szetszwo for working this.

One question: should the new executors be declared as ExecutorService and shutdown() when appropriate?

@@ -63,11 +64,15 @@
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.*;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;

class RaftServerProxy implements RaftServer {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May also need EXECUTOR:

public CompletableFuture<GroupInfoReply> getGroupInfoAsync(GroupInfoRequest request) {
return getImplFuture(request.getRaftGroupId()).thenApplyAsync(
server -> server.getGroupInfo(request));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks.

@szetszwo szetszwo force-pushed the RATIS-1497 branch 2 times, most recently from bd2129f to 0f83874 Compare January 22, 2022 14:26
@szetszwo
Copy link
Contributor Author

... should the new executors be declared as ExecutorService and shutdown() when appropriate?

The shutdown() method is to stop accepting new tasks. Yes, we should call shutdown() except for the static PeerProxyMap.EXECUTOR, shutdown() is not needed.

@szetszwo
Copy link
Contributor Author

BTW, I have reverted the LeaderStateImpl change since the GrpcClientProtocolService change will fix the reported problem.

LeaderStateImpl will be fixed by https://issues.apache.org/jira/browse/RATIS-1500 ( #588 )

@szetszwo
Copy link
Contributor Author

Due to the test failures, I keep only the grpc change here and have reverted the server change.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @szetszwo for updating the patch. The only failing test TestRaftOutputStreamWithGrpc is known to be flaky (RATIS-1493).

@szetszwo szetszwo merged commit f479974 into apache:master Jan 23, 2022
@szetszwo szetszwo changed the title RATIS-1497. Avoid using ForkJoinPool.commonPool(). RATIS-1497. Avoid using ForkJoinPool.commonPool() in GrpcClientProtocolService Jan 23, 2022
symious pushed a commit to symious/ratis that referenced this pull request Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants