Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
bce9a68b
"vscode:/vscode.git/clone" did not exist on "70d848e1faff36e778f8e32c5a86628574c22b00"
Commit
bce9a68b
authored
Mar 16, 2020
by
antirez
Browse files
Merge branch 'unstable' of github.com:/antirez/redis into unstable
parents
8609e681
15338ab6
Changes
2
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
bce9a68b
...
@@ -3040,16 +3040,22 @@ int handleClientsWithPendingReadsUsingThreads(void) {
...
@@ -3040,16 +3040,22 @@ int handleClientsWithPendingReadsUsingThreads(void) {
if (tio_debug) printf("I/O READ All threads finshed\n");
if (tio_debug) printf("I/O READ All threads finshed\n");
/* Run the list of clients again to process the new buffers. */
/* Run the list of clients again to process the new buffers. */
listRewind
(
server
.
clients_pending_read
,
&
li
);
while(listLength
(server.clients_pending_read
)) {
while
((
ln
=
list
Next
(
&
li
)))
{
ln = list
First(server.clients_pending_read);
client *c = listNodeValue(ln);
client *c = listNodeValue(ln);
c->flags &= ~CLIENT_PENDING_READ;
c->flags &= ~CLIENT_PENDING_READ;
listDelNode(server.clients_pending_read,ln);
if (c->flags & CLIENT_PENDING_COMMAND) {
if (c->flags & CLIENT_PENDING_COMMAND) {
c
->
flags
&=
~
CLIENT_PENDING_COMMAND
;
c->flags &= ~CLIENT_PENDING_COMMAND;
processCommandAndResetClient
(
c
);
if (processCommandAndResetClient(c) == C_ERR) {
/* If the client is no longer valid, we avoid
* processing the client later. So we just go
* to the next. */
continue;
}
}
}
processInputBufferAndReplicate(c);
processInputBufferAndReplicate(c);
}
}
listEmpty
(
server
.
clients_pending_read
);
return processed;
return processed;
}
}
src/server.c
View file @
bce9a68b
...
@@ -2088,6 +2088,9 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
...
@@ -2088,6 +2088,9 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
void beforeSleep(struct aeEventLoop *eventLoop) {
void beforeSleep(struct aeEventLoop *eventLoop) {
UNUSED(eventLoop);
UNUSED(eventLoop);
/* We should handle pending reads clients ASAP after event loop. */
handleClientsWithPendingReadsUsingThreads();
/* Handle TLS pending data. (must be done before flushAppendOnlyFile) */
/* Handle TLS pending data. (must be done before flushAppendOnlyFile) */
tlsProcessPendingData();
tlsProcessPendingData();
/* If tls still has pending unread data don't sleep at all. */
/* If tls still has pending unread data don't sleep at all. */
...
@@ -2157,7 +2160,6 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
...
@@ -2157,7 +2160,6 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
void afterSleep(struct aeEventLoop *eventLoop) {
void afterSleep(struct aeEventLoop *eventLoop) {
UNUSED(eventLoop);
UNUSED(eventLoop);
if (moduleCount()) moduleAcquireGIL();
if (moduleCount()) moduleAcquireGIL();
handleClientsWithPendingReadsUsingThreads();
}
}
/* =========================== Server initialization ======================== */
/* =========================== Server initialization ======================== */
...
...
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