Skip to content

Commit

Permalink
update rdb and module's child proc name to valkey
Browse files Browse the repository at this point in the history
Signed-off-by: Shivshankar-Reddy <[email protected]>
  • Loading branch information
Shivshankar-Reddy committed May 7, 2024
1 parent ba9dd7b commit 28b0642
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -11251,7 +11251,11 @@ int VM_Fork(ValkeyModuleForkDoneHandler cb, void *user_data) {

if ((childpid = serverFork(CHILD_TYPE_MODULE)) == 0) {
/* Child */
serverSetProcTitle("redis-module-fork");
if (strstr(server.exec_argv[0],"redis-server") != NULL) {
serverSetProcTitle("redis-module-fork");
} else {
serverSetProcTitle("valkey-module-fork");
}
} else if (childpid == -1) {
serverLog(LL_WARNING,"Can't fork for module: %s", strerror(errno));
} else {
Expand Down
13 changes: 10 additions & 3 deletions src/rdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,11 @@ int rdbSaveBackground(int req, char *filename, rdbSaveInfo *rsi, int rdbflags) {
int retval;

/* Child */
serverSetProcTitle("redis-rdb-bgsave");
if (strstr(server.exec_argv[0],"redis-server") != NULL) {
serverSetProcTitle("redis-rdb-bgsave");
} else {
serverSetProcTitle("valkey-rdb-bgsave");
}
serverSetCpuAffinity(server.bgsave_cpulist);
retval = rdbSave(req, filename,rsi,rdbflags);
if (retval == C_OK) {
Expand Down Expand Up @@ -3596,8 +3600,11 @@ int rdbSaveToSlavesSockets(int req, rdbSaveInfo *rsi) {
/* Close the reading part, so that if the parent crashes, the child will
* get a write error and exit. */
close(server.rdb_pipe_read);

serverSetProcTitle("redis-rdb-to-slaves");
if (strstr(server.exec_argv[0],"redis-server") != NULL) {
serverSetProcTitle("redis-rdb-to-slaves");
} else {
serverSetProcTitle("valkey-rdb-to-slaves");
}
serverSetCpuAffinity(server.bgsave_cpulist);

retval = rdbSaveRioWithEOFMark(req,&rdb,NULL,rsi);
Expand Down

0 comments on commit 28b0642

Please sign in to comment.