mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-02-08 10:51:06 +01:00
BUG/MEDIUM: peers: Peers CLOSE_WAIT issue.
A peer session which has just been created upon reconnect timeout expirations, could be right after shutdown (at peer session level) because the remote side peer could also righ after have connected. In such a case the underlying TCP session was still running (connect()/accept()) and finally left in CLOSE_WAIT state after the remote side stopped writting (shutdown(SHUT_WR)). Now on, with this patch we never shutdown such peer sessions wich have just been created. We leave them connect to the remote peer which is already connected and must shutdown its own peer session. Thanks to Patric Hemmer and Yves Lafon at w3.org for reporting this issue, and for having tested this patch on the field. Thanks also to Willy and Yelp blogs which helped me a lot in fixing it (see https://www.haproxy.com/blog/truly-seamless-reloads-with-haproxy-no-more-hacks/ and https://engineeringblog.yelp.com/2015/04/true-zero-downtime-haproxy-reloads.htmll).
This commit is contained in:
parent
a33510b215
commit
5df119008a
@ -1719,7 +1719,13 @@ static void peer_session_forceshutdown(struct appctx *appctx)
|
||||
{
|
||||
struct peer *ps;
|
||||
|
||||
if (!appctx)
|
||||
/* Note that the peer sessions which have just been created
|
||||
* (->st0 == PEER_SESS_ST_CONNECT) must not
|
||||
* be shutdown, if not, the TCP session will never be closed
|
||||
* and stay in CLOSE_WAIT state after having been closed by
|
||||
* the remote side.
|
||||
*/
|
||||
if (!appctx || appctx->st0 == PEER_SESS_ST_CONNECT)
|
||||
return;
|
||||
|
||||
if (appctx->applet != &peer_applet)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user