luaRedisGenericCommand() 递归调用检测到

我使用 Microsoft.Web.RedisSessionStateProvider 作为 sessionState 提供程序运行许多 lua 脚本。但是我的应用程序捕获了以下异常:

@user_script: 14: luaRedisGenericCommand() 递归调用检测到。 你在使用 Lua 调试钩子做一些有趣的事情吗?

redis 源代码 中,开发人员说:

static int inuse = 0;   /* 递归调用检测。*/

/* 通过使用 Lua 调试钩子,可以触发对 luaRedisGenericCommand() 的递归调用,这通常是不应该发生的。
 * 使此函数可重入是徒劳的,会使其变慢,但我们应该至少检测这种误用并进行中止。*/
if (inuse) {
    char *recursion_warning =
        "luaRedisGenericCommand() 递归调用检测到。"
        "你在使用 Lua 调试钩子做一些有趣的事情吗?";
    redisLog(REDIS_WARNING,"%s",recursion_warning);
    luaPushError(lua,recursion_warning);
    return 1;
}
inuse++;

但我不知道如何检测这种递归并避免此错误!

点赞
用户11224496
用户11224496
将下面翻译成中文并且保留原本的 markdown 格式,
Recycle the app pool and Clear the Redis Cache it will work Fine ..

翻译:

重新启动应用程序池并清除 Redis 缓存,它就会正常工作。

2019-09-10 12:57:19