]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: hlua: properly handle hlua_process_task HLUA_E_ETMOUT
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 24 Nov 2022 13:27:15 +0000 (14:27 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Apr 2023 06:58:16 +0000 (08:58 +0200)
In hlua_process_task: when HLUA_E_ETMOUT was returned by
hlua_ctx_resume(), meaning that the lua task reached
tune.lua.task-timeout (default: none),
we logged "Lua task: unknown error." before stopping the task.

Now we properly handle HLUA_E_ETMOUT to report a meaningful error
message.

src/hlua.c

index 263d254ed08065f83d3e27fb0ef868f85ef3c3f5..2ea15b995438d5b91be86e2e0592c6718e75afd4 100644 (file)
@@ -8576,16 +8576,16 @@ struct task *hlua_process_task(struct task *task, void *context, unsigned int st
                break;
 
        /* finished with error. */
+       case HLUA_E_ETMOUT:
+               SEND_ERR(NULL, "Lua task: execution timeout.\n");
+               goto err_task_abort;
        case HLUA_E_ERRMSG:
                SEND_ERR(NULL, "Lua task: %s.\n", lua_tostring(hlua->T, -1));
-               hlua_ctx_destroy(hlua);
-               task_destroy(task);
-               task = NULL;
-               break;
-
+               goto err_task_abort;
        case HLUA_E_ERR:
        default:
                SEND_ERR(NULL, "Lua task: unknown error.\n");
+       err_task_abort:
                hlua_ctx_destroy(hlua);
                task_destroy(task);
                task = NULL;