Skip to content
This repository was archived by the owner on Nov 18, 2020. It is now read-only.

Commit 8e9dd1e

Browse files
committed
Handle RpcStream.receive_list_items_with_fun/6 with a timeout of 0 precisely
Corrects the race condition caused by a 0 timeout by never dispatching the work associated with the stream.
1 parent f6eaae2 commit 8e9dd1e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/rabbitmq/cli/ctl/rpc_stream.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ defmodule RabbitMQ.CLI.Ctl.RpcStream do
114114
end)
115115
end
116116

117+
defp init_items_stream(_node, _mod, _fun, _args, 0, pid, ref) do
118+
set_stream_timeout(pid, ref, 0)
119+
end
120+
117121
defp init_items_stream(node, mod, fun, args, timeout, pid, ref) do
118122
:rabbit_control_misc.spawn_emitter_caller(node, mod, fun, args, ref, pid, timeout)
119123
set_stream_timeout(pid, ref, timeout)

0 commit comments

Comments
 (0)