Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/server/verifier-server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,19 @@ do_listen(swoc::IPEndpoint &server_addr, bool do_https, bool do_http3)
R"(Could not set reuseaddr on socket {}: {}.)",
socket_fd,
swoc::bwf::Errno{});
} else if (setsockopt(socket_fd, SOL_SOCKET, SO_REUSEPORT, &ONE, sizeof(int)) < 0) {
// SO_REUSEADDR alone permits binding a port left in TIME_WAIT, but not one
// still actively bound by a live listening socket. When the server is run
// back-to-back on the same port (e.g. an autest harness recycling ports
// across tests, where a prior server instance has not fully exited), the
// bind() below can fail with EADDRINUSE and the server exits without ever
// listening. SO_REUSEPORT lets the new listener bind alongside the
// departing one, eliminating that spurious startup failure.
Comment on lines +896 to +903
errata.note(
S_ERROR,
R"(Could not set reuseport on socket {}: {}.)",
socket_fd,
swoc::bwf::Errno{});
Comment on lines +896 to +908
} else if (
Send_Buffer_size > 0 &&
setsockopt(socket_fd, SOL_SOCKET, SO_SNDBUF, &Send_Buffer_size, sizeof(Send_Buffer_size)) <
Expand Down
Loading