From: Olivier Houchard Date: Wed, 19 Aug 2026 14:10:50 +0000 (+0200) Subject: MINOR: hlua: Forbid lua-load with per-tgroup fd tables X-Git-Tag: v3.5-dev5~5 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=ddf20dc96af47a0c9f7aa45ba31e44f25b88a525;p=haproxy.git MINOR: hlua: Forbid lua-load with per-tgroup fd tables lua-load may be used to create file descriptors that it expects to be global to the process, which is not true file tune.fd.tables per-thread-group, so forbid it. --- diff --git a/src/hlua.c b/src/hlua.c index 1958da548..1882db98a 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -12991,6 +12991,7 @@ static int hlua_load_state(char **args, lua_State *L, char **err) return 0; } +static int hlua_gload = 0; static int hlua_load(char **args, int section_type, struct proxy *curpx, const struct proxy *defpx, const char *file, int line, char **err) @@ -13005,6 +13006,7 @@ static int hlua_load(char **args, int section_type, struct proxy *curpx, /* loading for global state */ hlua_state_id = 0; ha_set_thread(NULL); + hlua_gload = 1; return hlua_load_state(&args[1], hlua_states[0], err); } @@ -13531,6 +13533,11 @@ int hlua_post_init() } #endif + if (hlua_gload && (global.tune.options & GTUNE_NO_TG_FD_SHARING) && + global.nbtgroups > 1) { + ha_alert("tune.fd.tables per-thread-groups is incompatible with lua-load, please use lua-load-per-thread"); + return 0; + } /* Perform post init of common thread */ hlua_state_id = 0; ha_set_thread(&ha_thread_info[0]);