Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
09f9e4b0
Unverified
Commit
09f9e4b0
authored
Nov 19, 2019
by
Salvatore Sanfilippo
Committed by
GitHub
Nov 19, 2019
Browse files
Merge pull request #6600 from oranagra/5_module_flags
module documentation mismatches: loading and fork child for 5.0 branch
parents
7a7fbe70
8d8d68dd
Changes
3
Show whitespace changes
Inline
Side-by-side
src/module.c
View file @
09f9e4b0
...
...
@@ -1518,6 +1518,8 @@ int RM_GetSelectedDb(RedisModuleCtx *ctx) {
* * REDISMODULE_CTX_FLAGS_OOM_WARNING: Less than 25% of memory remains before
* reaching the maxmemory level.
*
* * REDISMODULE_CTX_FLAGS_LOADING: Server is loading RDB/AOF
*
* * REDISMODULE_CTX_FLAGS_REPLICA_IS_STALE: No active link with the master.
*
* * REDISMODULE_CTX_FLAGS_REPLICA_IS_CONNECTING: The replica is trying to
...
...
@@ -1596,6 +1598,9 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) {
if (retval == C_ERR) flags |= REDISMODULE_CTX_FLAGS_OOM;
if (level > 0.75) flags |= REDISMODULE_CTX_FLAGS_OOM_WARNING;
/* Presence of children processes. */
if (hasActiveChildProcess()) flags |= REDISMODULE_CTX_FLAGS_ACTIVE_CHILD;
return flags;
}
...
...
src/server.c
View file @
09f9e4b0
...
...
@@ -779,6 +779,11 @@ void updateDictResizePolicy(void) {
dictDisableResize
();
}
int
hasActiveChildProcess
()
{
return
server
.
rdb_child_pid
!=
-
1
||
server
.
aof_child_pid
!=
-
1
;
}
/* ======================= Cron: called every 100 ms ======================== */
/* Add a sample to the operations per second array of samples. */
...
...
src/server.h
View file @
09f9e4b0
...
...
@@ -1653,6 +1653,7 @@ void openChildInfoPipe(void);
void
closeChildInfoPipe
(
void
);
void
sendChildInfo
(
int
process_type
);
void
receiveChildInfo
(
void
);
int
hasActiveChildProcess
();
/* Sorted sets data type */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment