Skip to content

Commit 2e7cb45

Browse files
z-bbszetszwo
authored andcommitted
RATIS-2140. Thread wait when installing snapshot. (#1137)
1 parent 557675f commit 2e7cb45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ private void installSnapshot(SnapshotInfo snapshot) {
770770

771771
while (isRunning() && !responseHandler.isDone()) {
772772
try {
773-
getEventAwaitForSignal().await();
773+
getEventAwaitForSignal().await(getWaitTimeMs(), TimeUnit.MILLISECONDS);
774774
} catch (InterruptedException ignored) {
775775
Thread.currentThread().interrupt();
776776
}
@@ -815,7 +815,7 @@ private void notifyInstallSnapshot(TermIndex firstAvailable) {
815815

816816
while (isRunning() && !responseHandler.isDone()) {
817817
try {
818-
getEventAwaitForSignal().await();
818+
getEventAwaitForSignal().await(getWaitTimeMs(), TimeUnit.MILLISECONDS);
819819
} catch (InterruptedException ignored) {
820820
Thread.currentThread().interrupt();
821821
}

0 commit comments

Comments
 (0)