MCPcopy Create free account
hub / github.com/F-Stack/f-stack / execCommandAbort

Function execCommandAbort

app/redis-6.2.6/src/multi.c:147–157  ·  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

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