if ((server.maxidletime && !(loops % 100)) || server.bpop_blocked_clients)
closeTimedoutClients();
- /* Check if a background saving or AOF rewrite in progress terminated */
+ /* Check if a background saving or AOF rewrite in progress terminated. */
if (server.bgsavechildpid != -1 || server.bgrewritechildpid != -1) {
int statloc;
pid_t pid;
}
updateDictResizePolicy();
}
+ } else if (server.bgsavethread != (pthread_t) -1) {
if (server.bgsavethread != (pthread_t) -1) {
int state;
state = server.bgsavethread_state;
pthread_mutex_unlock(&server.bgsavethread_mutex);
- if (state == REDIS_BGSAVE_DONE_OK || state == REDIS_BGSAVE_DONE_ERR)
+ if (state == REDIS_BGSAVE_THREAD_DONE_OK ||
+ state == REDIS_BGSAVE_THREAD_DONE_ERR)
{
backgroundSaveDoneHandler(
- (state == REDIS_BGSAVE_DONE_OK) ? 0 : 1, 0);
+ (state == REDIS_BGSAVE_THREAD_DONE_OK) ? 0 : 1, 0);
}
}
} else if (!server.ds_enabled) {
eta
);
}
+
+ info = sdscat(info,"allocation_stats:");
+ for (j = 0; j <= ZMALLOC_MAX_ALLOC_STAT; j++) {
+ size_t count = zmalloc_allocations_for_size(j);
+ if (count) {
+ if (info[sdslen(info)-1] != ':') info = sdscatlen(info,",",1);
+ info = sdscatprintf(info,"%s%d=%zu",
+ (j == ZMALLOC_MAX_ALLOC_STAT) ? ">=" : "",
+ j,count);
+ }
+ }
+ info = sdscat(info,"\r\n");
+
for (j = 0; j < server.dbnum; j++) {
long long keys, vkeys;