|
28 | 28 | import com.google.common.annotations.VisibleForTesting; |
29 | 29 | import com.google.common.base.MoreObjects; |
30 | 30 | import com.google.common.base.Preconditions; |
| 31 | +import com.google.common.util.concurrent.Futures; |
31 | 32 | import com.google.common.util.concurrent.ListenableFuture; |
32 | 33 | import com.google.common.util.concurrent.SettableFuture; |
33 | 34 | import io.grpc.Attributes; |
|
53 | 54 | import io.grpc.ServerServiceDefinition; |
54 | 55 | import io.grpc.ServerTransportFilter; |
55 | 56 | import io.grpc.Status; |
56 | | -import io.grpc.StatusException; |
57 | 57 | import io.perfmark.Link; |
58 | 58 | import io.perfmark.PerfMark; |
59 | 59 | import io.perfmark.Tag; |
@@ -606,17 +606,11 @@ public void runInContext() { |
606 | 606 |
|
607 | 607 | private void runInternal() { |
608 | 608 | ServerStreamListener listener = NOOP_LISTENER; |
609 | | - ServerCallParameters<?,?> callParameters; |
610 | 609 | try { |
611 | 610 | if (future.isCancelled()) { |
612 | 611 | return; |
613 | 612 | } |
614 | | - if (!future.isDone() || (callParameters = future.get()) == null) { |
615 | | - Status status = Status.INTERNAL.withDescription( |
616 | | - "Unexpected failure retrieving server call parameters."); |
617 | | - throw new StatusException(status); |
618 | | - } |
619 | | - listener = startWrappedCall(methodName, callParameters, headers); |
| 613 | + listener = startWrappedCall(methodName, Futures.getDone(future), headers); |
620 | 614 | } catch (Throwable ex) { |
621 | 615 | stream.close(Status.fromThrowable(ex), new Metadata()); |
622 | 616 | context.cancel(null); |
|
0 commit comments