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

Function rejectCommand

src/server.cpp:4738–4748  ·  view source on GitHub ↗

Used when a command that is ready for execution needs to be rejected, due to * varios pre-execution checks. it returns the appropriate error to the client. * If there's a transaction is flags it as dirty, and if the command is EXEC, * it aborts the transaction. * Note: 'reply' is expected to end with \r\n */

Source from the content-addressed store, hash-verified

4736 * it aborts the transaction.
4737 * Note: 'reply' is expected to end with \r\n */
4738void rejectCommand(client *c, robj *reply, int severity = ERR_CRITICAL) {
4739 flagTransaction(c);
4740 if (c->cmd) c->cmd->rejected_calls++;
4741 if (c->cmd && c->cmd->proc == execCommand) {
4742 execCommandAbort(c, szFromObj(reply));
4743 }
4744 else {
4745 /* using addReplyError* rather than addReply so that the error can be logged. */
4746 addReplyErrorObject(c, reply, severity);
4747 }
4748}
4749
4750void lfenceCommand(client *c) {
4751 c->mvccCheckpoint = getMvccTstamp();

Callers 1

processCommandFunction · 0.85

Calls 4

flagTransactionFunction · 0.85
execCommandAbortFunction · 0.85
szFromObjFunction · 0.85
addReplyErrorObjectFunction · 0.85

Tested by

no test coverage detected