]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hlua: don't call ha_alert() in hlua_event_subscribe()
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 4 Mar 2024 15:31:23 +0000 (16:31 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Mon, 4 Mar 2024 15:48:42 +0000 (16:48 +0100)
hlua_event_subscribe() is meant to be called from a protected lua env
during init and/or runtime. As such, only hlua_event_sub() makes uses
of it: when an error happens hlua_event_sub() will already raise a Lua
exception. Thus it's not relevant to use ha_alert() there as it could
generate log pollution (error is relevant from Lua script point of view,
not from haproxy one).

This could be backported in 2.8.

src/hlua.c

index 54d9fbcafbaf653325f940598bba4f800b019426..b28b78658fd38f7870ed06f3b3d86db30053bdb4 100644 (file)
@@ -9733,10 +9733,8 @@ static struct event_hdl_sub *hlua_event_subscribe(event_hdl_sub_list *list, stru
        hlua_sub->task = NULL;
        hlua_sub->hlua = NULL;
        hlua_sub->paused = 0;
-       if ((task = task_new_here()) == NULL) {
-               ha_alert("out of memory while allocating hlua event task");
+       if ((task = task_new_here()) == NULL)
                goto mem_error;
-       }
        task->process = hlua_event_runner;
        task->context = hlua_sub;
        event_hdl_async_equeue_init(&hlua_sub->equeue);