From: Willy Tarreau Date: Tue, 31 Jan 2023 18:14:31 +0000 (+0100) Subject: CLEANUP: config: remove test for impossible case regarding bind thread mask X-Git-Tag: v2.8-dev3~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53c6c673ac262448ae9a33d5d137f445fa7311ea;p=thirdparty%2Fhaproxy.git CLEANUP: config: remove test for impossible case regarding bind thread mask During 2.5 development, a fallback was implemented for bind "thread" directives that would not map to existing threads, with commit e3f4d7496 ("MEDIUM: config: resolve relative threads on bind lines to absolute ones"). The approch consisted in remapping the threads to other ones. But now that relative threads and not absolute threads are stored in this mask, this case cannot happen anymore, and this confusing hack is not needed anymore. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 78b32ee842..82e6c0849b 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2926,7 +2926,6 @@ init_proxies_list_stage1: /* check and reduce the bind-proc of each listener */ list_for_each_entry(bind_conf, &curproxy->conf.bind, by_fe) { - unsigned long mask; struct listener *li; /* HTTP frontends with "h2" as ALPN/NPN will work in @@ -2961,19 +2960,6 @@ init_proxies_list_stage1: curproxy->id, err, bind_conf->arg, bind_conf->file, bind_conf->line); free(err); cfgerr++; - } else if (!((mask = bind_conf->bind_thread) & ha_tgroup_info[bind_conf->bind_tgroup-1].threads_enabled)) { - unsigned long new_mask = 0; - ulong thr_mask = ha_tgroup_info[bind_conf->bind_tgroup-1].threads_enabled; - - while (mask) { - new_mask |= mask & thr_mask; - mask >>= ha_tgroup_info[bind_conf->bind_tgroup-1].count; - } - - bind_conf->bind_thread = new_mask; - ha_warning("Proxy '%s': the thread range specified on the 'thread' directive of 'bind %s' at [%s:%d] only refers to thread numbers out of the range supported by thread group %d (%d). The thread numbers were remapped to existing threads instead (mask 0x%lx).\n", - curproxy->id, bind_conf->arg, bind_conf->file, bind_conf->line, - bind_conf->bind_tgroup, ha_tgroup_info[bind_conf->bind_tgroup-1].count, new_mask); } /* apply thread masks and groups to all receivers */ @@ -4429,7 +4415,6 @@ init_proxies_list_stage2: struct list *l; struct bind_conf *bind_conf; struct listener *li; - unsigned long mask; l = &curpeers->peers_fe->conf.bind; bind_conf = LIST_ELEM(l->n, typeof(bind_conf), by_fe); @@ -4452,19 +4437,6 @@ init_proxies_list_stage2: curpeers->peers_fe->id, err, bind_conf->arg, bind_conf->file, bind_conf->line); free(err); cfgerr++; - } else if (!((mask = bind_conf->bind_thread) & ha_tgroup_info[bind_conf->bind_tgroup-1].threads_enabled)) { - unsigned long new_mask = 0; - ulong thr_mask = ha_tgroup_info[bind_conf->bind_tgroup-1].threads_enabled; - - while (mask) { - new_mask |= mask & thr_mask; - mask >>= ha_tgroup_info[bind_conf->bind_tgroup-1].count; - } - - bind_conf->bind_thread = new_mask; - ha_warning("Peers section '%s': the thread range specified on the 'thread' directive of 'bind %s' at [%s:%d] only refers to thread numbers out of the range supported by thread group %d (%d). The thread numbers were remapped to existing threads instead (mask 0x%lx).\n", - curpeers->peers_fe->id, bind_conf->arg, bind_conf->file, bind_conf->line, - bind_conf->bind_tgroup, ha_tgroup_info[bind_conf->bind_tgroup-1].count, new_mask); } /* apply thread masks and groups to all receivers */