From 18dc769104e895837a33997372ce1c53f5750dd6 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 20 Jan 2015 23:20:12 +0100 Subject: luaRedisGenericCommand(): log error at WARNING level when re-entered. Rationale is that when re-entering, it is likely due to Lua debugging hooks. Returning an error will be ignored in most cases, going totally unnoticed. With the log at least we leave a trace. Related to issue #2302. --- src/scripting.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/scripting.c b/src/scripting.c index 140799b09..46c0de9a2 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -220,8 +220,11 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) { * To make this function reentrant is futile and makes it slower, but * we should at least detect such a misuse, and abort. */ if (inuse) { - luaPushError(lua, - "luaRedisGenericCommand() recursive call detected. Are you doing funny stuff with Lua debug hooks?"); + char *recursion_warning = + "luaRedisGenericCommand() recursive call detected. " + "Are you doing funny stuff with Lua debug hooks?"; + redisLog(REDIS_WARNING,"%s",recursion_warning); + luaPushError(lua,recursion_warning); return 1; } inuse++; -- cgit v1.2.1