RM_GetContextFlags provides indication that we're in a fork child#7783
RM_GetContextFlags provides indication that we're in a fork child#7783oranagra merged 2 commits intoredis:unstablefrom oranagra:is_in_fork_child
Conversation
Also if the fork child is a module fork child, reduce the log level of sigKillChildHandler since some modules create a lot of forks and if floods the log.
| ldb.forked = (c->flags & CLIENT_LUA_DEBUG_SYNC) == 0; | ||
| if (ldb.forked) { | ||
| pid_t cp = redisFork(); | ||
| pid_t cp = redisFork(CHILD_TYPE_LDB); |
There was a problem hiding this comment.
no.. if it was a typo it would have failed to build.. 8-)
LDB = Lua Debugger (look at the function we're inside)
|
@oranagra What about backwards compatibility? |
|
@yossigo that's an interesting concern, but it's one that we completely ignored so far, so this new flag is not special in that respect. I suggest the following new API for the version / features check: @redis/core-team @guybe7 @MeirShpilraien please share your thoughts on both the current PR and the suggestion above. |
|
@oranagra IIRC this did come up while discussing |
|
@oranagra I agree with the new REDISMODULE_CTX_FLAGS_IS_CHILD flag, I also agree with the new suggested API but I believe we should also add a function like In addition, Maybe we should also do the same for the server events API? If you approve I will be happy to take it. |
|
@MeirShpilraien seems fine. let's wait a day for further feedback and then will be happy if you can take it. |
|
@oranagra @MeirShpilraien I'd prefer to have a dedicated issue/PR for this, and try to aim for a more generic macro to check availability of a specific flag or function. Function checks are easy (i.e.
etc. |
|
I agree, will open another issue with a suggestion and we can continue the discussion there. |
) (cherry picked from commit 2458e54)
Also if the fork child is a module fork child, reduce the log level
of sigKillChildHandler since some modules create a lot of forks and
if floods the log.