From eb65b1bd6ca1c2774f1cab09e0dfec90cfb0a1c7 Mon Sep 17 00:00:00 2001 From: Ke Wu Date: Thu, 10 Jun 2021 21:17:11 -0700 Subject: [PATCH] [BEAM-12419] Deadline should be reset for each gRPC call. getState() in waitForTerminalState() is invoked multiple times and deadline should be reset each time since it is an absolute number. --- .../beam/runners/portability/JobServicePipelineResult.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runners/portability/java/src/main/java/org/apache/beam/runners/portability/JobServicePipelineResult.java b/runners/portability/java/src/main/java/org/apache/beam/runners/portability/JobServicePipelineResult.java index 478c75569451..b631a810aecf 100644 --- a/runners/portability/java/src/main/java/org/apache/beam/runners/portability/JobServicePipelineResult.java +++ b/runners/portability/java/src/main/java/org/apache/beam/runners/portability/JobServicePipelineResult.java @@ -153,7 +153,7 @@ private void waitForTerminalState() { Thread.currentThread().interrupt(); throw new RuntimeException(e); } - response = stub.getState(request); + response = stub.withDeadlineAfter(jobServerTimeout, TimeUnit.SECONDS).getState(request); lastState = getJavaState(response.getState()); } terminalState = lastState;