Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
3bcffcbe
"vscode:/vscode.git/clone" did not exist on "3c19ae941d17dee7f89c282946bc379ba2106b09"
Commit
3bcffcbe
authored
Jan 17, 2011
by
Pieter Noordhuis
Browse files
Remove client from list of unblocked clients when it is free'd
parent
b8cfcea4
Changes
4
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
3bcffcbe
...
@@ -456,6 +456,13 @@ void freeClient(redisClient *c) {
...
@@ -456,6 +456,13 @@ void freeClient(redisClient *c) {
ln
=
listSearchKey
(
server
.
clients
,
c
);
ln
=
listSearchKey
(
server
.
clients
,
c
);
redisAssert
(
ln
!=
NULL
);
redisAssert
(
ln
!=
NULL
);
listDelNode
(
server
.
clients
,
ln
);
listDelNode
(
server
.
clients
,
ln
);
/* When client was just unblocked because of a blocking operation,
* remove it from the list with unblocked clients. */
if
(
c
->
flags
&
REDIS_UNBLOCKED
)
{
ln
=
listSearchKey
(
server
.
unblocked_clients
,
c
);
redisAssert
(
ln
!=
NULL
);
listDelNode
(
server
.
unblocked_clients
,
ln
);
}
/* Remove from the list of clients waiting for swapped keys, or ready
/* Remove from the list of clients waiting for swapped keys, or ready
* to be restarted, but not yet woken up again. */
* to be restarted, but not yet woken up again. */
if
(
c
->
flags
&
REDIS_IO_WAIT
)
{
if
(
c
->
flags
&
REDIS_IO_WAIT
)
{
...
...
src/redis.c
View file @
3bcffcbe
...
@@ -688,6 +688,7 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
...
@@ -688,6 +688,7 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
redisAssert
(
ln
!=
NULL
);
redisAssert
(
ln
!=
NULL
);
c
=
ln
->
value
;
c
=
ln
->
value
;
listDelNode
(
server
.
unblocked_clients
,
ln
);
listDelNode
(
server
.
unblocked_clients
,
ln
);
c
->
flags
&=
~
REDIS_UNBLOCKED
;
/* Process remaining data in the input buffer. */
/* Process remaining data in the input buffer. */
if
(
c
->
querybuf
&&
sdslen
(
c
->
querybuf
)
>
0
)
if
(
c
->
querybuf
&&
sdslen
(
c
->
querybuf
)
>
0
)
...
...
src/redis.h
View file @
3bcffcbe
...
@@ -136,6 +136,8 @@
...
@@ -136,6 +136,8 @@
#define REDIS_IO_WAIT 32
/* The client is waiting for Virtual Memory I/O */
#define REDIS_IO_WAIT 32
/* The client is waiting for Virtual Memory I/O */
#define REDIS_DIRTY_CAS 64
/* Watched keys modified. EXEC will fail. */
#define REDIS_DIRTY_CAS 64
/* Watched keys modified. EXEC will fail. */
#define REDIS_CLOSE_AFTER_REPLY 128
/* Close after writing entire reply. */
#define REDIS_CLOSE_AFTER_REPLY 128
/* Close after writing entire reply. */
#define REDIS_UNBLOCKED 256
/* This client was unblocked and is stored in
server.unblocked_clients */
/* Client request types */
/* Client request types */
#define REDIS_REQ_INLINE 1
#define REDIS_REQ_INLINE 1
...
...
src/t_list.c
View file @
3bcffcbe
...
@@ -773,7 +773,8 @@ void unblockClientWaitingData(redisClient *c) {
...
@@ -773,7 +773,8 @@ void unblockClientWaitingData(redisClient *c) {
zfree
(
c
->
bpop
.
keys
);
zfree
(
c
->
bpop
.
keys
);
c
->
bpop
.
keys
=
NULL
;
c
->
bpop
.
keys
=
NULL
;
c
->
bpop
.
target
=
NULL
;
c
->
bpop
.
target
=
NULL
;
c
->
flags
&=
(
~
REDIS_BLOCKED
);
c
->
flags
&=
~
REDIS_BLOCKED
;
c
->
flags
|=
REDIS_UNBLOCKED
;
server
.
bpop_blocked_clients
--
;
server
.
bpop_blocked_clients
--
;
listAddNodeTail
(
server
.
unblocked_clients
,
c
);
listAddNodeTail
(
server
.
unblocked_clients
,
c
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment