mirror of
https://github.com/wassname/ray.git
synced 2026-08-19 12:30:27 +08:00
Stopped nodes can rejoin immediately (#428)
* Ignore deleted clients when reading address info from Redis * Remove self from db_client table when exiting cleanly * Fix valgrind test * Do not call plasma_perform_release when disconnecting
This commit is contained in:
committed by
Robert Nishihara
parent
4043769ba2
commit
93679df724
@@ -183,9 +183,21 @@ DBHandle *db_connect(const char *db_address,
|
||||
}
|
||||
|
||||
void db_disconnect(DBHandle *db) {
|
||||
/* Notify others that this client is disconnecting from Redis. If a client of
|
||||
* the same type on the same node wants to reconnect again, they must
|
||||
* reconnect and get assigned a different client ID. */
|
||||
redisReply *reply =
|
||||
(redisReply *) redisCommand(db->sync_context, "RAY.DISCONNECT %b",
|
||||
db->client.id, sizeof(db->client.id));
|
||||
CHECK(strcmp(reply->str, "OK") == 0);
|
||||
freeReplyObject(reply);
|
||||
|
||||
/* Clean up the Redis connection state. */
|
||||
redisFree(db->sync_context);
|
||||
redisAsyncFree(db->context);
|
||||
redisAsyncFree(db->sub_context);
|
||||
|
||||
/* Clean up memory. */
|
||||
DBClientCacheEntry *e, *tmp;
|
||||
HASH_ITER(hh, db->db_client_cache, e, tmp) {
|
||||
free(e->addr);
|
||||
|
||||
Reference in New Issue
Block a user