MCPcopy Create free account
hub / github.com/acl-dev/acl / cluster_down

Method cluster_down

lib_acl_cpp/src/redis/redis_client_cluster.cpp:449–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449redis_client* redis_client_cluster::cluster_down(redis_command& cmd,
450 redis_client* conn, const char* ptr, int ntried)
451{
452 clear_slot(cmd.get_slot());
453
454 if (redirect_sleep_ > 0) {
455 logger("%s: redirect %d, slot %d, waiting %s ...",
456 conn->get_pool()->get_addr(), ntried,
457 cmd.get_slot(), ptr);
458 acl_doze(redirect_sleep_);
459 }
460
461 // �������Ӷ���黹�����ӳض��󣬲����ø����ӳ�Ϊ������״̬
462 connect_pool* conns = conn->get_pool();
463 conns->put(conn, false);
464 conns->set_alive(false);
465
466 conn = peek_conn(-1);
467 if (conn == NULL) {
468 logger_error("peek_conn NULL");
469 return NULL;
470 }
471
472 cmd.clear(true);
473 cmd.set_client_addr(*conn);
474 return conn;
475}
476
477const redis_result* redis_client_cluster::run(redis_command& cmd,
478 size_t nchild, int* timeout /* = NULL */)

Callers

nothing calls this directly

Calls 7

acl_dozeFunction · 0.85
get_slotMethod · 0.80
set_client_addrMethod · 0.80
get_addrMethod · 0.45
putMethod · 0.45
set_aliveMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected