haproxy/include/proto
Willy Tarreau a48c141f44 BUG/MAJOR: connection: refine the situations where we don't send shutw()
Since commit f9ce57e ("MEDIUM: connection: make conn_sock_shutw() aware
of lingering"), we refrain from performing the shutw() on the socket if
there is no lingering risk. But there is a problem with this in tunnel
and in TCP modes where a client is explicitly allowed to send a shutw
to the server, eventhough it it risky.

Not doing it creates this situation reported by Ricardo Fraile and
diagnosed by Christopher : a typical HTTP client (eg: curl) connecting
via the config below to an HTTP server would receive its response,
immediately close while the server remains in keep-alive mode. The
shutr() received by haproxy from the client is "propagated" to the
server side but not acted upon because fdtab[fd].linger_risk is set,
so we expect that the next close will immediately complete this
operation.

  listen proxy-tcp
    bind 127.0.0.1:8888
    mode tcp
    timeout connect 5s
    timeout server  10s
    timeout client  10s
    server server1 127.0.0.1:8000

But since the whole stream will not end until the server closes in
turn, the server doesn't close and haproxy expires on server timeout.
This problem has already struck by waking up an older bug and was
partially fixed with commit 8059351 ("BUG/MEDIUM: http: don't disable
lingering on requests with tunnelled responses") though it was not
enough.

The problem is that linger_risk is not suited here. In fact we need to
know whether or not it is desired to close normally or silently, and
whether or not a shutr() has already been received on this connection.

This is the approach this patch takes, and it solves the problem for
the various difficult modes (tcp, http-server-close, pretend-keepalive).

This fix needs to be backported to 1.8. Many thanks to Ricardo for
providing very detailed traces and configurations.
2017-12-22 18:54:05 +01:00
..
acl.h MINOR: acl: Pass the ACLs as an explicit parameter of build_acl_cond 2017-10-31 11:36:12 +01:00
action.h MINOR: action: Add function to check rules using an action ACT_ACTION_TRK_* 2017-10-31 11:36:12 +01:00
applet.h CLEANUP: pools: rename all pool functions and pointers to remove this "2" 2017-11-24 17:49:53 +01:00
arg.h
auth.h
backend.h
channel.h BUG/MEDIUM: stream-int: Don't loss write's notifs when a stream is woken up 2017-11-09 15:16:05 +01:00
checks.h BUILD: threads: Rename SPIN/RWLOCK macros using HA_ prefix 2017-11-07 11:10:24 +01:00
cli.h
compression.h
connection.h BUG/MAJOR: connection: refine the situations where we don't send shutw() 2017-12-22 18:54:05 +01:00
dns.h BUG/MINOR: dns: Don't try to get the server lock if it's already held. 2017-11-06 18:34:24 +01:00
fd.h MINOR: fd: cache-align fdtab and fdcache locks 2017-11-26 11:10:51 +01:00
filters.h CLEANUP: pools: rename all pool functions and pointers to remove this "2" 2017-11-24 17:49:53 +01:00
flt_http_comp.h
freq_ctr.h BUG/MAJOR: threads/freq_ctr: fix lock on freq counters. 2017-10-31 13:58:33 +01:00
frontend.h
h1.h BUG/MEDIUM: h1: ensure the chunk size parser can deal with full buffers 2017-11-10 11:17:08 +01:00
hdr_idx.h CLEANUP: pools: rename all pool functions and pointers to remove this "2" 2017-11-24 17:49:53 +01:00
hlua_fcn.h
hlua.h
lb_chash.h
lb_fas.h
lb_fwlc.h
lb_fwrr.h
lb_map.h MEDIUM: threads/lb: Make LB algorithms (lb_*.c) thread-safe 2017-10-31 13:58:31 +01:00
listener.h BUG/MEDIUM: mworker: does not close inherited FD 2017-11-15 19:53:33 +01:00
log.h CLEANUP: pools: rename all pool functions and pointers to remove this "2" 2017-11-24 17:49:53 +01:00
map.h
mux_pt.h MEDIUM: connection: start to introduce a mux layer between xprt and data 2017-10-31 18:03:23 +01:00
obj_type.h MINOR: connection: introduce conn_stream 2017-10-31 18:03:23 +01:00
openssl-compat.h
pattern.h
payload.h
peers.h
pipe.h
port_range.h
proto_http.h MINOR: http: add a function to check request's cache-control header field 2017-12-22 17:56:17 +01:00
proto_tcp.h
proto_udp.h
protocol.h
proxy.h MINOR/CLEANUP: proxy: rename "proxy" to "proxies_list" 2017-11-24 17:21:27 +01:00
queue.h CLEANUP: pools: rename all pool functions and pointers to remove this "2" 2017-11-24 17:49:53 +01:00
raw_sock.h
sample.h
server.h BUG/MINOR: dns: Fix SRV records with the new thread code. 2017-10-31 15:47:55 +01:00
session.h BUG/MEDIUM: peers: fix some track counter rules dont register entries for sync. 2017-11-29 19:16:22 +01:00
shctx.h MINOR: shctx: rename lock functions 2017-10-31 03:49:44 +01:00
signal.h CLEANUP: pools: rename all pool functions and pointers to remove this "2" 2017-11-24 17:49:53 +01:00
spoe.h
ssl_sock.h MAJOR: threads/ssl: Make SSL part thread-safe 2017-10-31 13:58:32 +01:00
stats.h
stick_table.h BUILD: threads: Rename SPIN/RWLOCK macros using HA_ prefix 2017-11-07 11:10:24 +01:00
stream_interface.h MAJOR: connection : Split struct connection into struct connection and struct conn_stream. 2017-10-31 18:03:23 +01:00
stream.h BUG/MEDIUM: peers: fix some track counter rules dont register entries for sync. 2017-11-29 19:16:22 +01:00
task.h BUG/MEDIUM: lua/notification: memory leak 2017-12-10 19:38:58 +01:00
tcp_rules.h MINOR: action: Use trk_idx instead of tcp/http_trk_idx 2017-10-31 11:36:12 +01:00
template.h
vars.h