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
| 177 | * process it for queries ready to be executed at a safe time. |
| 178 | */ |
| 179 | void 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. */ |
no test coverage detected