uber / tchannel-java

@@ -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
Files Complexity Coverage
tchannel-core/src/main/java/com/uber/tchannel 0 76.01%
tchannel-hyperbahn/src/main/java/com/uber/tchannel/hyperbahn 64.71% 59.41%
Project Totals (88 files) 64.71% 75.44%
1181.1
openjdk7=
TRAVIS_OS_NAME=linux
1
coverage:
2
  range: 50..99
3
  round: nearest
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading