mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-09 02:31:52 +00:00
BUG/MINOR: listener: enforce all_threads_mask on bind_thread on init
When intializing a listener, let's make sure the bind_thread mask is always limited to all_threads_mask when inserting the FD. This will avoid seeing listening FDs with bits corresponding to threads that are not active (e.g. when using "bind ... process 1/even"). The side effect is very limited, all that was identified is that atomic operations are used in fd_update_events() when not necessary. It's more a matter of long-term correctness in practice. This fix might be backported as far as 1.8 (then proto_sockpair must be dropped).
This commit is contained in:
parent
50b659476c
commit
0948a781fc
@ -158,7 +158,7 @@ static int sockpair_bind_listener(struct listener *listener, char *errmsg, int e
|
||||
listener->state = LI_LISTEN;
|
||||
|
||||
fd_insert(fd, listener, listener->proto->accept,
|
||||
thread_mask(listener->bind_conf->bind_thread));
|
||||
thread_mask(listener->bind_conf->bind_thread) & all_threads_mask);
|
||||
|
||||
return err;
|
||||
|
||||
|
@ -999,7 +999,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
|
||||
listener->state = LI_LISTEN;
|
||||
|
||||
fd_insert(fd, listener, listener->proto->accept,
|
||||
thread_mask(listener->bind_conf->bind_thread));
|
||||
thread_mask(listener->bind_conf->bind_thread) & all_threads_mask);
|
||||
|
||||
tcp_return:
|
||||
if (msg && errlen) {
|
||||
|
@ -343,7 +343,7 @@ static int uxst_bind_listener(struct listener *listener, char *errmsg, int errle
|
||||
listener->state = LI_LISTEN;
|
||||
|
||||
fd_insert(fd, listener, listener->proto->accept,
|
||||
thread_mask(listener->bind_conf->bind_thread));
|
||||
thread_mask(listener->bind_conf->bind_thread) & all_threads_mask);
|
||||
|
||||
return err;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user