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

Function queueClientForReprocessing

src/blocked.cpp:179–188  ·  view source on GitHub ↗

This function will schedule the client for reprocessing at a safe time. * * This is useful when a client was blocked for some reason (blocking operation, * CLIENT PAUSE, or whatever), because it may end with some accumulated query * buffer that needs to be processed ASAP: * * 1. When a client is blocked, its readable handler is still active. * 2. However in this case it only gets data into

Source from the content-addressed store, hash-verified

177 * process it for queries ready to be executed at a safe time.
178 */
179void queueClientForReprocessing(client *c) {
180 /* The client may already be into the unblocked list because of a previous
181 * blocking operation, don't add back it into the list multiple times. */
182 serverAssert(GlobalLocksAcquired());
183 std::unique_lock<fastlock> ul(c->lock);
184 if (!(c->flags & CLIENT_UNBLOCKED)) {
185 c->flags |= CLIENT_UNBLOCKED;
186 listAddNodeTail(g_pserver->rgthreadvar[c->iel].unblocked_clients,c);
187 }
188}
189
190/* Unblock a client calling the right function depending on the kind
191 * of operation the client is blocking for. */

Callers 2

unblockClientFunction · 0.85
evalGenericCommandFunction · 0.85

Calls 2

GlobalLocksAcquiredFunction · 0.85
listAddNodeTailFunction · 0.85

Tested by

no test coverage detected