"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/server.c" between
redis-6.0.7.tar.gz and redis-6.0.8.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

server.c  (redis-6.0.7):server.c  (redis-6.0.8)
skipping to change at line 2490 skipping to change at line 2490
* server instance. */ * server instance. */
if (access(server.executable,X_OK) == -1) { if (access(server.executable,X_OK) == -1) {
serverLog(LL_WARNING,"Can't restart: this process has no " serverLog(LL_WARNING,"Can't restart: this process has no "
"permissions to execute %s", server.executable); "permissions to execute %s", server.executable);
return C_ERR; return C_ERR;
} }
/* Config rewriting. */ /* Config rewriting. */
if (flags & RESTART_SERVER_CONFIG_REWRITE && if (flags & RESTART_SERVER_CONFIG_REWRITE &&
server.configfile && server.configfile &&
rewriteConfig(server.configfile) == -1) rewriteConfig(server.configfile, 0) == -1)
{ {
serverLog(LL_WARNING,"Can't restart: configuration rewrite process " serverLog(LL_WARNING,"Can't restart: configuration rewrite process "
"failed"); "failed");
return C_ERR; return C_ERR;
} }
/* Perform a proper shutdown. */ /* Perform a proper shutdown. */
if (flags & RESTART_SERVER_GRACEFULLY && if (flags & RESTART_SERVER_GRACEFULLY &&
prepareForShutdown(SHUTDOWN_NOFLAGS) != C_OK) prepareForShutdown(SHUTDOWN_NOFLAGS) != C_OK)
{ {
skipping to change at line 4729 skipping to change at line 4729
fclose(fp); fclose(fp);
return atoi(buf); return atoi(buf);
} }
void linuxMemoryWarnings(void) { void linuxMemoryWarnings(void) {
if (linuxOvercommitMemoryValue() == 0) { if (linuxOvercommitMemoryValue() == 0) {
serverLog(LL_WARNING,"WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_m emory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.ove rcommit_memory=1' for this to take effect."); serverLog(LL_WARNING,"WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_m emory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.ove rcommit_memory=1' for this to take effect.");
} }
if (THPIsEnabled()) { if (THPIsEnabled()) {
serverLog(LL_WARNING,"WARNING you have Transparent Huge Pages (THP) supp ort enabled in your kernel. This will create latency and memory usage issues wit h Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transpar ent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to reta in the setting after a reboot. Redis must be restarted after THP is disabled."); serverLog(LL_WARNING,"WARNING you have Transparent Huge Pages (THP) supp ort enabled in your kernel. This will create latency and memory usage issues wit h Redis. To fix this issue run the command 'echo madvise > /sys/kernel/mm/transp arent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to re tain the setting after a reboot. Redis must be restarted after THP is disabled ( set to 'madvise' or 'never').");
} }
} }
#endif /* __linux__ */ #endif /* __linux__ */
void createPidFile(void) { void createPidFile(void) {
/* If pidfile requested, but no pidfile defined, use /* If pidfile requested, but no pidfile defined, use
* default pidfile path */ * default pidfile path */
if (!server.pidfile) server.pidfile = zstrdup(CONFIG_DEFAULT_PID_FILE); if (!server.pidfile) server.pidfile = zstrdup(CONFIG_DEFAULT_PID_FILE);
/* Try to write the pid file in a best-effort way. */ /* Try to write the pid file in a best-effort way. */
skipping to change at line 5234 skipping to change at line 5234
"Sentinel config from STDIN not allowed."); "Sentinel config from STDIN not allowed.");
serverLog(LL_WARNING, serverLog(LL_WARNING,
"Sentinel needs config file on disk to save state. Exiting...") ; "Sentinel needs config file on disk to save state. Exiting...") ;
exit(1); exit(1);
} }
resetServerSaveParams(); resetServerSaveParams();
loadServerConfig(configfile,options); loadServerConfig(configfile,options);
sdsfree(options); sdsfree(options);
} }
server.supervised = redisIsSupervised(server.supervised_mode);
int background = server.daemonize && !server.supervised;
if (background) daemonize();
serverLog(LL_WARNING, "oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo"); serverLog(LL_WARNING, "oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo");
serverLog(LL_WARNING, serverLog(LL_WARNING,
"Redis version=%s, bits=%d, commit=%s, modified=%d, pid=%d, just started ", "Redis version=%s, bits=%d, commit=%s, modified=%d, pid=%d, just started ",
REDIS_VERSION, REDIS_VERSION,
(sizeof(long) == 8) ? 64 : 32, (sizeof(long) == 8) ? 64 : 32,
redisGitSHA1(), redisGitSHA1(),
strtol(redisGitDirty(),NULL,10) > 0, strtol(redisGitDirty(),NULL,10) > 0,
(int)getpid()); (int)getpid());
if (argc == 1) { if (argc == 1) {
serverLog(LL_WARNING, "Warning: no config file specified, using the defa ult config. In order to specify a config file use %s /path/to/%s.conf", argv[0], server.sentinel_mode ? "sentinel" : "redis"); serverLog(LL_WARNING, "Warning: no config file specified, using the defa ult config. In order to specify a config file use %s /path/to/%s.conf", argv[0], server.sentinel_mode ? "sentinel" : "redis");
} else { } else {
serverLog(LL_WARNING, "Configuration loaded"); serverLog(LL_WARNING, "Configuration loaded");
} }
server.supervised = redisIsSupervised(server.supervised_mode);
int background = server.daemonize && !server.supervised;
if (background) daemonize();
readOOMScoreAdj(); readOOMScoreAdj();
initServer(); initServer();
if (background || server.pidfile) createPidFile(); if (background || server.pidfile) createPidFile();
redisSetProcTitle(argv[0]); redisSetProcTitle(argv[0]);
redisAsciiArt(); redisAsciiArt();
checkTcpBacklogSettings(); checkTcpBacklogSettings();
if (!server.sentinel_mode) { if (!server.sentinel_mode) {
/* Things not needed when running in Sentinel mode. */ /* Things not needed when running in Sentinel mode. */
serverLog(LL_WARNING,"Server initialized"); serverLog(LL_WARNING,"Server initialized");
#ifdef __linux__ #ifdef __linux__
 End of changes. 5 change blocks. 
6 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)