public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Cyril Bonté" <cyril.bonte@free.fr>
Cc: netdev@vger.kernel.org, Daniel Baluta <daniel.baluta@gmail.com>,
	Gaspar Chilingarov <gasparch@gmail.com>,
	Charles Duffy <charles@dyfis.net>, Willy Tarreau <w@1wt.eu>
Subject: Re: tcp: disallow bind() to reuse addr/port regression in 2.6.38
Date: Sat, 02 Apr 2011 20:10:48 +0200	[thread overview]
Message-ID: <1301767848.2837.14.camel@edumazet-laptop> (raw)
In-Reply-To: <201104022001.48144.cyril.bonte@free.fr>

Le samedi 02 avril 2011 à 20:01 +0200, Cyril Bonté a écrit :
> Hi All,
> 
> (2nd try to fix the mailing list address)
> 
> It has been reported that kernel 2.6.38 prevented the load balancer haproxy to 
> reload. After reading the kernel Changelog, it looks like the following commit 
> has a negative side effect on the the way haproxy "pauses" its listening 
> sockets to start a new process :
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c191a836a908d1dd6b40c503741f91b914de3348
> 
> Disabling the TCPF_CLOSE flag condition reallows to work as before. I guess 
> this was done for good reasons (Sorry, I haven't found the thread about that 
> commit in the archives yet) but other applications may also be impacted by 
> this change.
> 
> I add Willy Tarreau to the CC to open the discussion.
> 

> 		if (shutdown(listenfd, SHUT_WR) == 0 &&
> 		    listen(listenfd, 1024) == 0 &&
> 		    shutdown(listenfd, SHUT_RD) == 0) {
> 			printf("shutdown OK\n");
> 		}
> 	}
> 	exit(0);
> }
> 

Wow, not clear what this is doing.... 

for sure the listen() call is not needed ?

And the shutdown(listenfd, SHUT_WR) is clearly useless too.

I feel you only needed the shutdown(listenfd, SHUT_RD) call.

Why haproxy needs to setup a second listening socket on same port ?



  reply	other threads:[~2011-04-02 18:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-02 18:01 tcp: disallow bind() to reuse addr/port regression in 2.6.38 Cyril Bonté
2011-04-02 18:10 ` Eric Dumazet [this message]
2011-04-02 18:46   ` Cyril Bonté
2011-04-02 19:15     ` Willy Tarreau
2011-04-02 19:44       ` Eric Dumazet
2011-04-02 20:37         ` Willy Tarreau
2011-04-02 21:00           ` Cyril Bonté
2011-04-02 21:18             ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301767848.2837.14.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=charles@dyfis.net \
    --cc=cyril.bonte@free.fr \
    --cc=daniel.baluta@gmail.com \
    --cc=gasparch@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox