0
votes

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"

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?

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?

Here is the haproxy.cfg:

listen tomcat_frontend 
bind *:8080
timeout client 5000ms
timeout server 5000ms
mode http
option httpclose
option httplog
acl myservice_tomcat path_beg /myservice
use_backend tomcat_myservice_backend if myservice_tomcat
backend tomcat_myservice_backend
option forwardfor
option redispatch
retries 30
server server-2 :8080 check inter 10
server server-1 :8080 check inter 10
balance leastconn
mode http
1

1 Answers

0
votes

Very old question, but one of the top search hits for the "retr" error. A little information per the CSV docs (the 'w' prefix means warning and the 'e' for error):

eresp [..BS]: response errors. srv_abrt will be counted here also.
     Some other errors are:
     - write error on the client socket (won't be counted for the server stat)
     - failure applying filters to the response.
wretr [..BS]: number of times a connection to a server was retried.
wredis [..BS]: number of times a request was redispatched to another
     server. The server value counts the number of times that server was
     switched away from.