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
b221ca41
Unverified
Commit
b221ca41
authored
Aug 31, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Aug 31, 2018
Browse files
Merge pull request #5300 from SaschaRoland/xread-block-5299
#5299 Fix blocking XREAD for streams that ran dry
parents
4cb9ee11
eea0d3c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_stream.c
View file @
b221ca41
...
@@ -1436,7 +1436,7 @@ void xreadCommand(client *c) {
...
@@ -1436,7 +1436,7 @@ void xreadCommand(client *c) {
* synchronously in case the group top item delivered is smaller
* synchronously in case the group top item delivered is smaller
* than what the stream has inside. */
* than what the stream has inside. */
streamID
*
last
=
&
groups
[
i
]
->
last_id
;
streamID
*
last
=
&
groups
[
i
]
->
last_id
;
if
(
streamCompareID
(
&
s
->
last_id
,
last
)
>
0
)
{
if
(
s
->
length
&&
(
streamCompareID
(
&
s
->
last_id
,
last
)
>
0
)
)
{
serve_synchronously
=
1
;
serve_synchronously
=
1
;
*
gt
=
*
last
;
*
gt
=
*
last
;
}
}
...
@@ -1444,7 +1444,7 @@ void xreadCommand(client *c) {
...
@@ -1444,7 +1444,7 @@ void xreadCommand(client *c) {
}
else
{
}
else
{
/* For consumers without a group, we serve synchronously if we can
/* For consumers without a group, we serve synchronously if we can
* actually provide at least one item from the stream. */
* actually provide at least one item from the stream. */
if
(
streamCompareID
(
&
s
->
last_id
,
gt
)
>
0
)
{
if
(
s
->
length
&&
(
streamCompareID
(
&
s
->
last_id
,
gt
)
>
0
)
)
{
serve_synchronously
=
1
;
serve_synchronously
=
1
;
}
}
}
}
...
...
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