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

Function execCommandAbort

src/multi.cpp:150–160  ·  view source on GitHub ↗

Aborts a transaction, with a specific error message. * The transaction is always aborted with -EXECABORT so that the client knows * the server exited the multi state, but the actual reason for the abort is * included too. * Note: 'error' may or may not end with \r\n. see addReplyErrorFormat. */

Source from the content-addressed store, hash-verified

148 * included too.
149 * Note: 'error' may or may not end with \r\n. see addReplyErrorFormat. */
150void execCommandAbort(client *c, sds error) {
151 discardTransaction(c);
152
153 if (error[0] == '-') error++;
154 addReplyErrorFormat(c, "-EXECABORT Transaction discarded because of: %s", error);
155
156 /* Send EXEC to clients waiting data from MONITOR. We did send a MULTI
157 * already, and didn't send any of the queued commands, now we'll just send
158 * EXEC so it is clear that the transaction is over. */
159 replicationFeedMonitors(c,g_pserver->monitors,c->db->id,c->argv,c->argc);
160}
161
162void execCommand(client *c) {
163 int j;

Callers 2

rejectCommandFunction · 0.85
rejectCommandFormatFunction · 0.85

Calls 3

discardTransactionFunction · 0.85
addReplyErrorFormatFunction · 0.85
replicationFeedMonitorsFunction · 0.85

Tested by

no test coverage detected