Skip to content

Commit

Permalink
Delete empty pubsub keys (ray-project#3146)
Browse files Browse the repository at this point in the history
We found that there are large amount of pub-sub keys with no content in it (This case is worse when wait-id is used in the key name.).
This logic of deleting empty pub-sub keys from GCS was in legacy ray but not in raylet.
  • Loading branch information
guoyuhong authored and robertnishihara committed Oct 27, 2018
1 parent 6531eed commit befbf78
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ray/gcs/redis_module/ray_redis_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,10 @@ int TableCancelNotifications_RedisCommand(RedisModuleCtx *ctx, RedisModuleString
if (RedisModule_KeyType(notification_key) != REDISMODULE_KEYTYPE_EMPTY) {
RAY_CHECK(RedisModule_ZsetRem(notification_key, client_channel, NULL) ==
REDISMODULE_OK);
size_t size = RedisModule_ValueLength(notification_key);
if (size == 0) {
CHECK_ERROR(RedisModule_DeleteKey(notification_key), "Unable to delete zset key.");
}
}

RedisModule_ReplyWithSimpleString(ctx, "OK");
Expand Down

0 comments on commit befbf78

Please sign in to comment.