symious commented on code in PR #1363:
URL: https://github.com/apache/ratis/pull/1363#discussion_r2915428267
##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java:
##########
@@ -57,10 +58,8 @@
import java.util.Optional;
import java.util.Queue;
import java.util.UUID;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;
Review Comment:
Fixed.
##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java:
##########
@@ -341,20 +340,37 @@ private boolean haveTooManyPendingRequests() {
}
static class StreamObservers {
- private final CallStreamObserver<AppendEntriesRequestProto> appendLog;
- private final CallStreamObserver<AppendEntriesRequestProto> heartbeat;
+ private final ClientCallStreamObserver<AppendEntriesRequestProto>
appendLog;
+ private final ClientCallStreamObserver<AppendEntriesRequestProto>
heartbeat;
private final TimeDuration waitForReady;
+ private final TimeDuration completeGracePeriod;
private volatile boolean running = true;
+ private final ScheduledExecutorService closer =
+ Executors.newSingleThreadScheduledExecutor(r -> {
+ Thread t = new Thread(r, "grpc-log-appender-stream-closer");
+ t.setDaemon(true);
+ return t;
+ });
+
+// private final AtomicBoolean closing = new AtomicBoolean(false);
Review Comment:
Fixed.
--
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]