]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: config: remove test for impossible case regarding bind thread mask
authorWilly Tarreau <w@1wt.eu>
Tue, 31 Jan 2023 18:14:31 +0000 (19:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 3 Feb 2023 17:00:20 +0000 (18:00 +0100)
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.

src/cfgparse.c

index 78b32ee8420cdb8aab667ea63369c7682f888e1c..82e6c0849b1c82e931ed4dd2f78f32c4c19fb8f3 100644 (file)
@@ -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 */