title: HAProxy - connection reset during transfer
body: <p>I am using HAProxy in front of 2 webapps deployed in tomcat. When testing High Availability, I made 10000 requests and at some point I kill one of the tomcat instances. For 1 or 2 requests I get some errors. My request are sent using Spring's RestTemplate. Here is the exception:
  "org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://:8080/myservice/_doaction":Unexpected end of file from server; nested exception is java.net.SocketException: Unexpected end of file from server"</p>
  
  <p>The HAProxy stats says in the "Errors" section, "Resp" subsection, when I hover over the number shown there, which is 2 : "Connection resets during transfers:1 client, 2 servers". What this means? </p>
  
  <p>Also, on the "Warnings" section I have "Retr":29 and "Redis":1. This tells me that the request is being redispatched to a "living" server. Is this assumption correct?</p>
  
  <p>Here is the haproxy.cfg:</p>
  
  <pre>
  listen tomcat_frontend <br> 
    bind *:8080<br>
    timeout client 5000ms<br>
    timeout server 5000ms<br>
    mode http<br>
    option httpclose<br>
    option httplog<br>
    acl myservice_tomcat path_beg /myservice<br>
    use_backend tomcat_myservice_backend if myservice_tomcat<br>
  
  backend tomcat_myservice_backend<br>
    option forwardfor<br>
    option redispatch<br>
    retries 30<br>
    server server-2 :8080 check inter 10<br>
    server server-1 :8080 check inter 10<br>
    balance leastconn<br>
    mode http<br></pre>