File tree
Expand file treeCollapse file tree1 file changed
+8
-1
lines changed alts/src/main/java/io/grpc/alts/internal
Expand file treeCollapse file tree1 file changed
+8
-1
lines changed Original file line number | Diff line number | Diff line change |
---|
|
16 | 16 |
|
17 | 17 | package io.grpc.alts.internal;
|
18 | 18 |
|
| 19 | +import static java.util.concurrent.TimeUnit.SECONDS; |
| 20 | + |
19 | 21 | import com.google.common.annotations.VisibleForTesting;
|
20 | 22 | import com.google.common.base.Optional;
|
21 | 23 | import io.grpc.alts.internal.HandshakerServiceGrpc.HandshakerServiceStub;
|
@@ -32,8 +34,13 @@ class AltsHandshakerStub {
|
32 | 34 | new ArrayBlockingQueue<>(1);
|
33 | 35 | private final AtomicReference<String> exceptionMessage = new AtomicReference<>();
|
34 | 36 |
|
| 37 | +private static final long HANDSHAKE_RPC_DEADLINE_SECS = 20; |
| 38 | + |
35 | 39 | AltsHandshakerStub(HandshakerServiceStub serviceStub) {
|
36 |
| -this.writer = serviceStub.doHandshake(this.reader); |
| 40 | +this.writer = |
| 41 | +serviceStub |
| 42 | +.withDeadlineAfter(HANDSHAKE_RPC_DEADLINE_SECS, SECONDS) |
| 43 | +.doHandshake(this.reader); |
37 | 44 | }
|
38 | 45 |
|
39 | 46 | @VisibleForTesting
|
|
You can’t perform that action at this time.
0 commit comments