diff --git a/include/haproxy/receiver-t.h b/include/haproxy/receiver-t.h index 4527b5f41..d9f280e46 100644 --- a/include/haproxy/receiver-t.h +++ b/include/haproxy/receiver-t.h @@ -36,6 +36,7 @@ #define RX_F_INHERITED 0x00000002 /* inherited FD from the parent process (fd@) or duped from another local receiver */ #define RX_F_MWORKER 0x00000004 /* keep the FD open in the master but close it in the children */ #define RX_F_MUST_DUP 0x00000008 /* this receiver's fd must be dup() from a reference; ignore socket-level ops here */ +#define RX_F_NON_SUSPENDABLE 0x00000010 /* this socket cannot be suspended hence must always be unbound */ /* Bit values for rx_settings->options */ #define RX_O_FOREIGN 0x00000001 /* receives on foreign addresses */ diff --git a/src/sock.c b/src/sock.c index 7ec4d4600..7fcdc103f 100644 --- a/src/sock.c +++ b/src/sock.c @@ -234,6 +234,7 @@ void sock_unbind(struct receiver *rx) { /* There are a number of situations where we prefer to keep the FD and * not to close it (unless we're stopping, of course): + * - worker process unbinding from a worker's non-suspendable FD (ABNS) => close * - worker process unbinding from a worker's FD with socket transfer enabled => keep * - master process unbinding from a master's inherited FD => keep * - master process unbinding from a master's FD => close @@ -247,6 +248,7 @@ void sock_unbind(struct receiver *rx) if (!stopping && !master && !(rx->flags & RX_F_MWORKER) && + !(rx->flags & RX_F_NON_SUSPENDABLE) && (global.tune.options & GTUNE_SOCKET_TRANSFER)) return; diff --git a/src/sock_unix.c b/src/sock_unix.c index 1f7da504d..ef749a53a 100644 --- a/src/sock_unix.c +++ b/src/sock_unix.c @@ -340,6 +340,13 @@ int sock_unix_bind_receiver(struct receiver *rx, char **errmsg) rx->fd = fd; rx->flags |= RX_F_BOUND; + if (!path[0]) { + /* ABNS sockets do not support suspend, and they conflict with + * other ones (no reuseport), so they must always be unbound. + */ + rx->flags |= RX_F_NON_SUSPENDABLE; + } + fd_insert(fd, rx->owner, rx->iocb, rx->bind_tgroup, rx->bind_thread); /* for now, all regularly bound TCP listeners are exportable */