Hello,
I am using HAProxy to load balance a .NET / Net.TCP application.
The application works but if there is an idle of 1 minute or more, an exception is created by the caller -
This channel can no longer be used to send messages as the output session was auto-closed due to a server-initiated shutdown. Either disable auto-close by setting the DispatchRuntime.AutomaticInputSessionShutdown to false, or consider modifying the shutdown protocol with the remote server.
If we remove HAProxy from the middle, wait a minute or more between requests, this message never appears.
What is going on here? More importantly how can I stop this from happening?
It seems like the client (HAProxy in this case) is initiating the close.
haproxy.cfg -
global
log 127.0.0.1 local3
log /dev/log local0
log /dev/log local0 debug
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd lis$
stats socket ipv4@0.0.0.0:1979 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
nbproc 2
cpu-map 1 1
cpu-map 2 2
maxconn 100000
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL). This list is from:
# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
# An alternative list with additional directives can be obtained from
# https://mozilla.github.io/server-side-tls/ssl-config-generator/?serv$
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:EC$
ssl-default-bind-options no-sslv3
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
listen stats # Define a listen section called "stats"
bind *:80 # Listen on localhost:80
mode http
stats enable # Enable stats page
stats hide-version # Hide HAProxy version
stats realm Haproxy\ Statistics # Title text for popup window
stats uri /haproxy_stats # Stats URI
#stats auth Username:Password # Authentication credentials
dotnetconfg -
frontend lt_dotnet_7078_frontend
bind *:7078
mode tcp
option clitcpka
default_backend lt_dotnet_backend
backend lt_dotnet_backend
timeout connect 5000
option tcp-check
option tcplog
option srvtcpka
mode tcp
balance roundrobin
server server02_10.11.20.32_7078 10.11.20.32:7078 check port 7078 inter 200
Help is appreciated.