uber / tchannel-java

Compare d333f32 ... +1 ... b051e68

Coverage Reach
tchannel-core/src/main/java/com/uber/tchannel/messages/Request.java tchannel-core/src/main/java/com/uber/tchannel/messages/Response.java tchannel-core/src/main/java/com/uber/tchannel/messages/EncodedRequest.java tchannel-core/src/main/java/com/uber/tchannel/messages/RawRequest.java tchannel-core/src/main/java/com/uber/tchannel/messages/EncodedResponse.java tchannel-core/src/main/java/com/uber/tchannel/messages/RawResponse.java tchannel-core/src/main/java/com/uber/tchannel/messages/ThriftRequest.java tchannel-core/src/main/java/com/uber/tchannel/messages/JsonRequest.java tchannel-core/src/main/java/com/uber/tchannel/messages/ThriftResponse.java tchannel-core/src/main/java/com/uber/tchannel/messages/ThriftSerializer.java tchannel-core/src/main/java/com/uber/tchannel/messages/JsonResponse.java tchannel-core/src/main/java/com/uber/tchannel/messages/ErrorResponse.java tchannel-core/src/main/java/com/uber/tchannel/messages/JSONSerializer.java tchannel-core/src/main/java/com/uber/tchannel/messages/Serializer.java tchannel-core/src/main/java/com/uber/tchannel/messages/ResponseMessage.java tchannel-core/src/main/java/com/uber/tchannel/handlers/RequestRouter.java tchannel-core/src/main/java/com/uber/tchannel/handlers/ResponseRouter.java tchannel-core/src/main/java/com/uber/tchannel/handlers/OutRequest.java tchannel-core/src/main/java/com/uber/tchannel/handlers/MessageDefragmenter.java tchannel-core/src/main/java/com/uber/tchannel/handlers/LoadControlHandler.java tchannel-core/src/main/java/com/uber/tchannel/handlers/MessageFragmenter.java tchannel-core/src/main/java/com/uber/tchannel/handlers/InitRequestHandler.java tchannel-core/src/main/java/com/uber/tchannel/handlers/InitRequestInitiator.java tchannel-core/src/main/java/com/uber/tchannel/handlers/PingHandler.java tchannel-core/src/main/java/com/uber/tchannel/frames/CallRequestFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/ErrorFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/CallFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/CallResponseFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/InitResponseFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/Frame.java tchannel-core/src/main/java/com/uber/tchannel/frames/FrameType.java tchannel-core/src/main/java/com/uber/tchannel/frames/InitRequestFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/CallResponseContinueFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/CancelFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/CallRequestContinueFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/ClaimFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/PingRequestFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/PingResponseFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/PingFrame.java tchannel-core/src/main/java/com/uber/tchannel/frames/InitFrame.java tchannel-core/src/main/java/com/uber/tchannel/api/TChannel.java tchannel-core/src/main/java/com/uber/tchannel/api/SubChannel.java tchannel-core/src/main/java/com/uber/tchannel/api/TFuture.java tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelError.java tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelConnectionReset.java tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelConnectionTimeout.java tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelProtocol.java tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelNoPeerAvailable.java tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelConnectionFailure.java tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelInterrupted.java tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelCodec.java tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelWrappedError.java tchannel-core/src/main/java/com/uber/tchannel/api/handlers/ThriftAsyncRequestHandler.java tchannel-core/src/main/java/com/uber/tchannel/api/handlers/JSONRequestHandler.java tchannel-core/src/main/java/com/uber/tchannel/api/handlers/RawRequestHandler.java tchannel-core/src/main/java/com/uber/tchannel/api/handlers/DefaultTypedRequestHandler.java tchannel-core/src/main/java/com/uber/tchannel/api/handlers/HealthCheckRequestHandler.java tchannel-core/src/main/java/com/uber/tchannel/api/handlers/ThriftRequestHandler.java tchannel-core/src/main/java/com/uber/tchannel/api/ResponseCode.java tchannel-core/src/main/java/com/uber/tchannel/channels/Connection.java tchannel-core/src/main/java/com/uber/tchannel/channels/PeerManager.java tchannel-core/src/main/java/com/uber/tchannel/channels/Peer.java tchannel-core/src/main/java/com/uber/tchannel/channels/SubPeer.java tchannel-core/src/main/java/com/uber/tchannel/channels/ConnectionState.java tchannel-core/src/main/java/com/uber/tchannel/channels/ChannelRegistrar.java tchannel-core/src/main/java/com/uber/tchannel/codecs/CodecUtils.java tchannel-core/src/main/java/com/uber/tchannel/codecs/MessageCodec.java tchannel-core/src/main/java/com/uber/tchannel/codecs/TFrameCodec.java tchannel-core/src/main/java/com/uber/tchannel/codecs/TFrame.java tchannel-core/src/main/java/com/uber/tchannel/codecs/TChannelLengthFieldBasedFrameDecoder.java tchannel-core/src/main/java/com/uber/tchannel/tracing/Tracing.java tchannel-core/src/main/java/com/uber/tchannel/tracing/PrefixedHeadersCarrier.java tchannel-core/src/main/java/com/uber/tchannel/tracing/OpenTracingContext.java tchannel-core/src/main/java/com/uber/tchannel/tracing/TracingContext.java tchannel-core/src/main/java/com/uber/tchannel/tracing/Trace.java tchannel-core/src/main/java/com/uber/tchannel/errors/ErrorType.java tchannel-core/src/main/java/com/uber/tchannel/errors/BadRequestError.java tchannel-core/src/main/java/com/uber/tchannel/errors/BusyError.java tchannel-core/src/main/java/com/uber/tchannel/errors/FatalProtocolError.java tchannel-core/src/main/java/com/uber/tchannel/errors/ProtocolError.java tchannel-core/src/main/java/com/uber/tchannel/headers/RetryFlag.java tchannel-core/src/main/java/com/uber/tchannel/headers/ArgScheme.java tchannel-core/src/main/java/com/uber/tchannel/utils/TChannelUtilities.java tchannel-core/src/main/java/com/uber/tchannel/checksum/ChecksumType.java tchannel-core/src/main/java/com/uber/tchannel/checksum/Checksums.java tchannel-hyperbahn/src/main/java/com/uber/tchannel/hyperbahn/api/HyperbahnClient.java tchannel-hyperbahn/src/main/java/com/uber/tchannel/hyperbahn/messages/AdvertiseRequest.java tchannel-hyperbahn/src/main/java/com/uber/tchannel/hyperbahn/messages/AdvertiseResponse.java

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -22,6 +22,7 @@
Loading
22 22
23 23
package com.uber.tchannel.handlers;
24 24
25 +
import com.google.common.annotations.VisibleForTesting;
25 26
import com.uber.tchannel.api.TChannel;
26 27
import com.uber.tchannel.api.errors.TChannelConnectionReset;
27 28
import com.uber.tchannel.channels.PeerManager;
@@ -71,6 +72,14 @@
Loading
71 72
        this.maxPendingRequests = topChannel.getClientMaxPendingRequests();
72 73
    }
73 74
75 +
    @VisibleForTesting
76 +
    ResponseRouter(@NotNull TChannel topChannel, @NotNull PeerManager peerManager, @NotNull HashedWheelTimer timer) {
77 +
        this.peerManager = peerManager;
78 +
        this.resetOnTimeoutLimit = topChannel.getResetOnTimeoutLimit();
79 +
        this.timer = timer;
80 +
        this.maxPendingRequests = topChannel.getClientMaxPendingRequests();
81 +
    }
82 +
74 83
    @Override
75 84
    public void channelActive(@NotNull ChannelHandlerContext ctx) throws Exception {
76 85
        super.channelActive(ctx);
@@ -183,6 +192,11 @@
Loading
183 192
        }
184 193
185 194
        if (response != null) {
195 +
            // Reset timeout counter if we receive a non-timeout response.
196 +
            if (!(response.isError() &&
197 +
                    ErrorType.Timeout.equals(((ErrorResponse) response).getErrorType()))) {
198 +
                timeouts.set(0);
199 +
            }
186 200
            response.touch("ResponseRouter.handleResponse(...)");
187 201
        }
188 202

Learn more Showing 4 files with coverage changes found.

Changes in tchannel-core/src/main/java/com/uber/tchannel/handlers/RequestRouter.java
-1
-1
+2
Loading file...
Changes in tchannel-core/src/main/java/com/uber/tchannel/handlers/OutRequest.java
-1
-2
+3
Loading file...
Changes in tchannel-core/src/main/java/com/uber/tchannel/api/SubChannel.java
-4
-7
+11
Loading file...
Changes in tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelNoPeerAvailable.java
-2
+2
Loading file...
Files Complexity Coverage
tchannel-core/src/main/java/com/uber/tchannel/api/ResponseCode.java ø 81.82%
tchannel-core/src/main/java/com/uber/tchannel/api/SubChannel.java ø +10.58% 87.50%
tchannel-core/src/main/java/com/uber/tchannel/api/TChannel.java ø 68.12%
tchannel-core/src/main/java/com/uber/tchannel/api/TFuture.java ø 76.92%
tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelCodec.java ø 0.00%
...e/src/main/java/com/uber/tchannel/api/errors/TChannelConnectionFailure.java ø 100.00%
...ore/src/main/java/com/uber/tchannel/api/errors/TChannelConnectionReset.java ø 50.00%
...e/src/main/java/com/uber/tchannel/api/errors/TChannelConnectionTimeout.java ø 0.00%
tchannel-core/src/main/java/com/uber/tchannel/api/errors/TChannelError.java ø 100.00%
...el-core/src/main/java/com/uber/tchannel/api/errors/TChannelInterrupted.java ø 0.00%
...ore/src/main/java/com/uber/tchannel/api/errors/TChannelNoPeerAvailable.java ø +100.00% 100.00%
...annel-core/src/main/java/com/uber/tchannel/api/errors/TChannelProtocol.java ø 0.00%
...l-core/src/main/java/com/uber/tchannel/api/errors/TChannelWrappedError.java ø 0.00%
...rc/main/java/com/uber/tchannel/api/handlers/DefaultTypedRequestHandler.java ø 0.00%
...src/main/java/com/uber/tchannel/api/handlers/HealthCheckRequestHandler.java ø 100.00%
...l-core/src/main/java/com/uber/tchannel/api/handlers/JSONRequestHandler.java ø 100.00%
...el-core/src/main/java/com/uber/tchannel/api/handlers/RawRequestHandler.java ø 0.00%
...src/main/java/com/uber/tchannel/api/handlers/ThriftAsyncRequestHandler.java ø 40.00%
...core/src/main/java/com/uber/tchannel/api/handlers/ThriftRequestHandler.java ø 100.00%
...channel-core/src/main/java/com/uber/tchannel/channels/ChannelRegistrar.java ø 76.92%
tchannel-core/src/main/java/com/uber/tchannel/channels/Connection.java ø 67.01%
tchannel-core/src/main/java/com/uber/tchannel/channels/ConnectionState.java ø 42.11%
tchannel-core/src/main/java/com/uber/tchannel/channels/Peer.java ø 79.31%
tchannel-core/src/main/java/com/uber/tchannel/channels/PeerManager.java ø 95.45%
tchannel-core/src/main/java/com/uber/tchannel/channels/SubPeer.java ø 75.76%
tchannel-core/src/main/java/com/uber/tchannel/checksum/ChecksumType.java ø 66.67%
tchannel-core/src/main/java/com/uber/tchannel/checksum/Checksums.java ø 41.67%
tchannel-core/src/main/java/com/uber/tchannel/codecs/CodecUtils.java ø 71.81%
tchannel-core/src/main/java/com/uber/tchannel/codecs/MessageCodec.java ø 61.40%
...ain/java/com/uber/tchannel/codecs/TChannelLengthFieldBasedFrameDecoder.java ø 100.00%
tchannel-core/src/main/java/com/uber/tchannel/codecs/TFrame.java ø 56.00%
tchannel-core/src/main/java/com/uber/tchannel/codecs/TFrameCodec.java ø 100.00%
tchannel-core/src/main/java/com/uber/tchannel/errors/BadRequestError.java ø 75.00%
tchannel-core/src/main/java/com/uber/tchannel/errors/BusyError.java ø 75.00%
tchannel-core/src/main/java/com/uber/tchannel/errors/ErrorType.java ø 70.37%
...channel-core/src/main/java/com/uber/tchannel/errors/FatalProtocolError.java ø 0.00%
tchannel-core/src/main/java/com/uber/tchannel/errors/ProtocolError.java ø 100.00%
tchannel-core/src/main/java/com/uber/tchannel/frames/CallFrame.java ø 59.52%
...l-core/src/main/java/com/uber/tchannel/frames/CallRequestContinueFrame.java ø 96.15%
tchannel-core/src/main/java/com/uber/tchannel/frames/CallRequestFrame.java ø 91.11%
...-core/src/main/java/com/uber/tchannel/frames/CallResponseContinueFrame.java ø 89.29%
tchannel-core/src/main/java/com/uber/tchannel/frames/CallResponseFrame.java ø 90.24%
tchannel-core/src/main/java/com/uber/tchannel/frames/CancelFrame.java ø 100.00%
tchannel-core/src/main/java/com/uber/tchannel/frames/ClaimFrame.java ø 100.00%
tchannel-core/src/main/java/com/uber/tchannel/frames/ErrorFrame.java ø 80.95%
tchannel-core/src/main/java/com/uber/tchannel/frames/Frame.java ø 87.10%
tchannel-core/src/main/java/com/uber/tchannel/frames/FrameType.java ø 93.10%
tchannel-core/src/main/java/com/uber/tchannel/frames/InitFrame.java ø 100.00%
tchannel-core/src/main/java/com/uber/tchannel/frames/InitRequestFrame.java ø 96.55%
tchannel-core/src/main/java/com/uber/tchannel/frames/InitResponseFrame.java ø 96.97%
tchannel-core/src/main/java/com/uber/tchannel/frames/PingFrame.java ø 100.00%
tchannel-core/src/main/java/com/uber/tchannel/frames/PingRequestFrame.java ø 87.50%
tchannel-core/src/main/java/com/uber/tchannel/frames/PingResponseFrame.java ø 87.50%
...annel-core/src/main/java/com/uber/tchannel/handlers/InitRequestHandler.java ø 100.00%
...nel-core/src/main/java/com/uber/tchannel/handlers/InitRequestInitiator.java ø 69.23%
...annel-core/src/main/java/com/uber/tchannel/handlers/LoadControlHandler.java ø 89.29%
...nnel-core/src/main/java/com/uber/tchannel/handlers/MessageDefragmenter.java ø 83.33%
...hannel-core/src/main/java/com/uber/tchannel/handlers/MessageFragmenter.java ø 80.77%
tchannel-core/src/main/java/com/uber/tchannel/handlers/OutRequest.java ø +3.37% 79.78%
tchannel-core/src/main/java/com/uber/tchannel/handlers/PingHandler.java ø 100.00%
tchannel-core/src/main/java/com/uber/tchannel/handlers/RequestRouter.java ø +1.57% 78.74%
tchannel-core/src/main/java/com/uber/tchannel/handlers/ResponseRouter.java ø +1.99% 78.13%
tchannel-core/src/main/java/com/uber/tchannel/headers/ArgScheme.java ø 58.33%
tchannel-core/src/main/java/com/uber/tchannel/headers/RetryFlag.java ø 72.00%
tchannel-core/src/main/java/com/uber/tchannel/messages/EncodedRequest.java ø 69.49%
tchannel-core/src/main/java/com/uber/tchannel/messages/EncodedResponse.java ø 50.00%
tchannel-core/src/main/java/com/uber/tchannel/messages/ErrorResponse.java ø 82.35%
tchannel-core/src/main/java/com/uber/tchannel/messages/JSONSerializer.java ø 71.43%
tchannel-core/src/main/java/com/uber/tchannel/messages/JsonRequest.java ø 51.35%
tchannel-core/src/main/java/com/uber/tchannel/messages/JsonResponse.java ø 46.43%
tchannel-core/src/main/java/com/uber/tchannel/messages/RawRequest.java ø 82.46%
tchannel-core/src/main/java/com/uber/tchannel/messages/RawResponse.java ø 50.00%
tchannel-core/src/main/java/com/uber/tchannel/messages/Request.java ø 78.13%
tchannel-core/src/main/java/com/uber/tchannel/messages/Response.java ø 69.53%
tchannel-core/src/main/java/com/uber/tchannel/messages/ResponseMessage.java ø 80.00%
tchannel-core/src/main/java/com/uber/tchannel/messages/Serializer.java ø 84.62%
tchannel-core/src/main/java/com/uber/tchannel/messages/ThriftRequest.java ø 62.79%
tchannel-core/src/main/java/com/uber/tchannel/messages/ThriftResponse.java ø 55.88%
...channel-core/src/main/java/com/uber/tchannel/messages/ThriftSerializer.java ø 76.47%
...hannel-core/src/main/java/com/uber/tchannel/tracing/OpenTracingContext.java ø 90.91%
...el-core/src/main/java/com/uber/tchannel/tracing/PrefixedHeadersCarrier.java ø 93.55%
tchannel-core/src/main/java/com/uber/tchannel/tracing/Trace.java ø 85.71%
tchannel-core/src/main/java/com/uber/tchannel/tracing/Tracing.java ø 85.07%
tchannel-core/src/main/java/com/uber/tchannel/tracing/TracingContext.java ø 88.89%
tchannel-core/src/main/java/com/uber/tchannel/utils/TChannelUtilities.java ø 80.65%
...yperbahn/src/main/java/com/uber/tchannel/hyperbahn/api/HyperbahnClient.java 72.73% 57.83%
...hn/src/main/java/com/uber/tchannel/hyperbahn/messages/AdvertiseRequest.java 50.00% 64.29%
...n/src/main/java/com/uber/tchannel/hyperbahn/messages/AdvertiseResponse.java 50.00% 75.00%
Project Totals (88 files) 64.71% 75.44%
Loading