Skip to content

Commit 0ce6ad0

Browse files
committed
Add a flush handler to amqp_channel
rabbit_channel may use amqp_channel as the writer. When terminating, rabbit_channel sends a `flush` message to its writer. If amqp_channel is in use, that led to a `function_clause` crash.
1 parent 0ec41c6 commit 0ce6ad0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

deps/amqp_client/src/amqp_channel.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ init([Driver, Connection, ChannelNumber, Consumer, Identity]) ->
384384
handle_call(open, From, State) ->
385385
{noreply, rpc_top_half(#'channel.open'{}, none, From, none, noflow, State)};
386386
%% @private
387+
handle_call(flush, _From, State) ->
388+
flush_writer(State),
389+
{noreply, State};
390+
%% @private
387391
handle_call({close, Code, Text}, From, State) ->
388392
handle_close(Code, Text, From, State);
389393
%% @private

0 commit comments

Comments
 (0)