Skip to content

Commit

Permalink
Fix for Netflix#127
Browse files Browse the repository at this point in the history
Handle the case where the hystrix RibbonCommand timed-out before the ribbon client received a response from origin.
So in this situation we want to release the connection now, as we know that the zuul filter chain has already continued
without us and therefore won't cleanup itself.
  • Loading branch information
kerumai committed Jun 8, 2016
1 parent d084b1b commit 73d86bf
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,19 @@ HttpResponse forward() throws Exception {

HttpResponse response = restClient.executeWithLoadBalancer(httpClientRequest);
context.setZuulResponse(response);

// Here we want to handle the case where this hystrix command timed-out before the
// ribbon client received a response from origin. So in this situation we want to
// cleanup this response (release connection) now, as we know that the zuul filter
// chain has already continued without us and therefore won't cleanup itself.
if (isResponseTimedOut()) {
response.close();
}

return response;
}



public static class UnitTest {

Expand Down

0 comments on commit 73d86bf

Please sign in to comment.