Fix issue #300
Former-commit-id: bee7f398c9c3b4c01b687d26194913bf215dca36
This commit is contained in:
parent
e943b60a39
commit
40fdf5670c
@ -2403,6 +2403,7 @@ void processInputBuffer(client *c, bool fParse, int callFlags) {
|
|||||||
/* Return if we're still parsing this command */
|
/* Return if we're still parsing this command */
|
||||||
auto &cmd = c->vecqueuedcmd.front();
|
auto &cmd = c->vecqueuedcmd.front();
|
||||||
if (cmd.argc != cmd.argcMax) break;
|
if (cmd.argc != cmd.argcMax) break;
|
||||||
|
if (c->flags & CLIENT_EXECUTING_COMMAND) break;
|
||||||
|
|
||||||
if (!FClientReady(c)) break;
|
if (!FClientReady(c)) break;
|
||||||
|
|
||||||
@ -2421,13 +2422,16 @@ void processInputBuffer(client *c, bool fParse, int callFlags) {
|
|||||||
if (c->argc == 0) {
|
if (c->argc == 0) {
|
||||||
resetClient(c);
|
resetClient(c);
|
||||||
} else {
|
} else {
|
||||||
|
c->flags |= CLIENT_EXECUTING_COMMAND;
|
||||||
/* We are finally ready to execute the command. */
|
/* We are finally ready to execute the command. */
|
||||||
if (processCommandAndResetClient(c, callFlags) == C_ERR) {
|
if (processCommandAndResetClient(c, callFlags) == C_ERR) {
|
||||||
/* If the client is no longer valid, we avoid exiting this
|
/* If the client is no longer valid, we avoid exiting this
|
||||||
* loop and trimming the client buffer later. So we return
|
* loop and trimming the client buffer later. So we return
|
||||||
* ASAP in that case. */
|
* ASAP in that case. */
|
||||||
|
c->flags &= ~CLIENT_EXECUTING_COMMAND;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
c->flags &= ~CLIENT_EXECUTING_COMMAND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -506,10 +506,8 @@ extern int configOOMScoreAdjValuesDefaults[CONFIG_OOM_COUNT];
|
|||||||
#define CLIENT_PENDING_READ (1<<29) /* The client has pending reads and was put
|
#define CLIENT_PENDING_READ (1<<29) /* The client has pending reads and was put
|
||||||
in the list of clients we can read
|
in the list of clients we can read
|
||||||
from. */
|
from. */
|
||||||
#define CLIENT_PENDING_COMMAND (1<<30) /* Used in threaded I/O to signal after
|
#define CLIENT_EXECUTING_COMMAND (1<<30) /* Used to handle reentrency cases in processCommandWhileBlocked
|
||||||
we return single threaded that the
|
to ensure we don't process a client already executing */
|
||||||
client has already pending commands
|
|
||||||
to be executed. */
|
|
||||||
#define CLIENT_TRACKING (1ULL<<31) /* Client enabled keys tracking in order to
|
#define CLIENT_TRACKING (1ULL<<31) /* Client enabled keys tracking in order to
|
||||||
perform client side caching. */
|
perform client side caching. */
|
||||||
#define CLIENT_TRACKING_BROKEN_REDIR (1ULL<<32) /* Target client is invalid. */
|
#define CLIENT_TRACKING_BROKEN_REDIR (1ULL<<32) /* Target client is invalid. */
|
||||||
|
@ -430,6 +430,21 @@ start_server {tags {"scripting"}} {
|
|||||||
set res
|
set res
|
||||||
} {102}
|
} {102}
|
||||||
|
|
||||||
|
test {EVAL with pipelined command (No crash)} {
|
||||||
|
r flushall
|
||||||
|
r config set lua-time-limit 1
|
||||||
|
set rd [redis_deferring_client]
|
||||||
|
$rd eval {for i=1,1000000 do redis.call('set', i, 'sdfdsfd') end} 0
|
||||||
|
$rd set testkey foo
|
||||||
|
$rd get testkey
|
||||||
|
after 1200
|
||||||
|
catch {r echo "foo"} err
|
||||||
|
assert_match {BUSY*} $err
|
||||||
|
$rd read
|
||||||
|
$rd close
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
test {EVAL timeout from AOF} {
|
test {EVAL timeout from AOF} {
|
||||||
# generate a long running script that is propagated to the AOF as script
|
# generate a long running script that is propagated to the AOF as script
|
||||||
# make sure that the script times out during loading
|
# make sure that the script times out during loading
|
||||||
|
Loading…
x
Reference in New Issue
Block a user