struct rspamd_lua_process_cbdata *cbdata;
struct rspamd_abstract_worker_ctx *actx;
struct rspamd_srv_command srv_cmd;
- const gchar *cmdline = NULL, *input = NULL;
+ const gchar *cmdline = NULL, *input = NULL, *proctitle = NULL;
gsize inputlen = 0;
pid_t pid;
GError *err = NULL;
if (!rspamd_lua_parse_table_arguments (L, 2, &err,
RSPAMD_LUA_PARSE_ARGUMENTS_DEFAULT,
- "func=F;exec=S;stdin=V;*on_complete=F", &func_cbref,
- &cmdline, &inputlen, &input, &cb_cbref)) {
+ "func=F;exec=S;stdin=V;*on_complete=F;proctitle=S", &func_cbref,
+ &cmdline, &inputlen, &input, &cb_cbref, &proctitle)) {
msg_err ("cannot get parameters list: %e", err);
if (err) {
rspamd_socket_blocking (cbdata->sp[1]);
g_hash_table_remove_all (w->signal_events);
ev_loop_destroy (cbdata->event_loop);
+
+ if (proctitle) {
+ setproctitle ("lua process: %s", proctitle);
+ }
+ else {
+ setproctitle ("lua process: unnamed");
+ }
+
cbdata->event_loop = ev_loop_new (EVFLAG_SIGNALFD);
rspamd_worker_unblock_signals ();
rspamd_lua_execute_lua_subprocess (L, cbdata);
local redis_lua_script_can_store_train_vec = [[
local prefix = KEYS[1]
local locked = redis.call('HGET', prefix, 'lock')
- if locked then return {tostring(-1),'locked by another process: ' .. locked} end
+ if locked then return {tostring(-1),'locked by another process till: ' .. locked} end
local nspam = 0
local nham = 0
local lim = tonumber(KEYS[3])
worker:spawn_process{
func = train,
on_complete = ann_trained,
+ proctitle = string.format("ANN train for %s/%s", rule.prefix, set.name),
}
end
-- Spawn learn and register lock extension