MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / removeClientFromTimeoutTable

Function removeClientFromTimeoutTable

src/timeout.cpp:126–133  ·  view source on GitHub ↗

Remove the client from the table when it is unblocked for reasons * different than timing out. */

Source from the content-addressed store, hash-verified

124/* Remove the client from the table when it is unblocked for reasons
125 * different than timing out. */
126void removeClientFromTimeoutTable(client *c) {
127 if (!(c->flags & CLIENT_IN_TO_TABLE)) return;
128 c->flags &= ~CLIENT_IN_TO_TABLE;
129 uint64_t timeout = c->bpop.timeout;
130 unsigned char buf[CLIENT_ST_KEYLEN];
131 encodeTimeoutKey(buf,timeout,c);
132 raxRemove(g_pserver->clients_timeout_table,buf,sizeof(buf),NULL);
133}
134
135/* This function is called in beforeSleep() in order to unblock clients
136 * that are waiting in blocking operations with a timeout set. */

Callers 1

unblockClientFunction · 0.85

Calls 2

encodeTimeoutKeyFunction · 0.85
raxRemoveFunction · 0.85

Tested by

no test coverage detected