mirror of https://github.com/grpc/grpc-java.git
services: turn channelz null futures into Status.UNIMPLEMENTED (#4346)
Then channelz GUI will take this into account. This is particularly useful for InProcessTransport, where I have decided we do not need special support for in channelz. The server and channel stats are already sufficient.
This commit is contained in:
parent
791a29f63b
commit
c04278ea07
|
@ -226,7 +226,6 @@ final class InProcessTransport implements ServerTransport, ConnectionClientTrans
|
|||
|
||||
@Override
|
||||
public ListenableFuture<SocketStats> getStats() {
|
||||
// TODO(zpencer): add transport tracing to in-process server
|
||||
SettableFuture<SocketStats> ret = SettableFuture.create();
|
||||
ret.set(null);
|
||||
return ret;
|
||||
|
|
|
@ -376,7 +376,14 @@ final class ChannelzProtoUtil {
|
|||
|
||||
private static <T> T getFuture(ListenableFuture<T> future) {
|
||||
try {
|
||||
return future.get();
|
||||
T ret = future.get();
|
||||
if (ret == null) {
|
||||
throw Status.UNIMPLEMENTED
|
||||
.withDescription("The entity's stats can not be retrieved. "
|
||||
+ "If this is an InProcessTransport this is expected.")
|
||||
.asRuntimeException();
|
||||
}
|
||||
return ret;
|
||||
} catch (InterruptedException e) {
|
||||
throw Status.INTERNAL.withCause(e).asRuntimeException();
|
||||
} catch (ExecutionException e) {
|
||||
|
|
Loading…
Reference in New Issue