From 268b15b5894a0345783042d6fc2a026cbfd9696e Mon Sep 17 00:00:00 2001 From: Michal Kuratczyk Date: Wed, 2 Apr 2025 23:38:55 +0200 Subject: [PATCH] Ignore stream connections in unexpected states A connection which terminated before it was fully established would lead to a function_clause, since metadata is not available to really call notify_connection_closed. We can just ignore such connections and not notify about them. Resolves https://github.com/rabbitmq/rabbitmq-server/discussions/13670 (cherry picked from commit 09ed8fdc075cf9226170db8e2ee965306e4f29e3) --- deps/rabbitmq_stream/src/rabbit_stream_reader.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deps/rabbitmq_stream/src/rabbit_stream_reader.erl b/deps/rabbitmq_stream/src/rabbit_stream_reader.erl index 56ddf4d4730f..f069e25b0488 100644 --- a/deps/rabbitmq_stream/src/rabbit_stream_reader.erl +++ b/deps/rabbitmq_stream/src/rabbit_stream_reader.erl @@ -3221,7 +3221,9 @@ notify_connection_closed(#statem_data{ {client_properties, ClientProperties}], rabbit_event:notify(connection_closed, augment_infos_with_user_provided_connection_name(EventProperties, - Connection)). + Connection)); +notify_connection_closed(#statem_data{}) -> + ok. handle_frame_post_close(_Transport, Connection,