]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
msgr: only SO_REUSEADDR when specific port is specified
authorSage Weil <sage@newdream.net>
Tue, 21 Jun 2011 19:47:32 +0000 (12:47 -0700)
committerSage Weil <sage@newdream.net>
Tue, 21 Jun 2011 19:47:32 +0000 (12:47 -0700)
commit2e7d06c6a300b2c17de34b65857aa62e92f1dfd1
tree34be6769ad3deaeff06d4c98f5b1ee7c8b5ffbe0
parent282575a2c55138fd385b2b4db7d6f52f4c4cd512
msgr: only SO_REUSEADDR when specific port is specified

In general SO_REUSEADDR is slightly dangerous, but avoids waiting for the
timeout when restarting servers.  This is important when binding to a
specific port.

When binding to a random port, it doesn't matter.  Also, it appears that
two processes can bind() to the same port with that flag set, and then one
will fail with EADDRINUSE on listen().  That's racy when starting up
daemons that should be binding to unique/random ports.

Signed-off-by: Sage Weil <sage@newdream.net>
src/msg/SimpleMessenger.cc