MINOR: hlua: properly handle hlua_process_task HLUA_E_ETMOUT

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.
This commit is contained in:
Aurelien DARRAGON 2022-11-24 14:27:15 +01:00 committed by Christopher Faulet
parent 0ebd41ff50
commit 795441073c

View 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;