When second request in failover scenario is made to check whether the failover was done, server fails to respond. With Undertow as a balancer, this behavior cannot be reproduced. When I replace the jvmroute part by worker which is still alive, I got expected response.
# curl -v --cookie "JSESSIONID=54yxdncGr5im0fBLqIIUMon0klbS66X16aYC_cVW.jboss-eap-7.2-3" http://172.17.0.2:2080/clusterbench/jvmroute
* About to connect() to 172.17.0.2 port 2080 (#0)
* Trying 172.17.0.2...
* Connected to 172.17.0.2 (172.17.0.2) port 2080 (#0)
> GET /clusterbench/jvmroute HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 172.17.0.2:2080
> Accept: */*
> Cookie: JSESSIONID=54yxdncGr5im0fBLqIIUMon0klbS66X16aYC_cVW.jboss-eap-7.2-3
* Empty reply from server
* Connection #0 to host 172.17.0.2 left intact
curl: (52) Empty reply from server