From b657be2b7948c545b8552c9d75bd066fcceb0bca Mon Sep 17 00:00:00 2001 From: David Ansari Date: Thu, 13 Feb 2025 14:38:44 +0000 Subject: [PATCH] Trap exit in AMQP 1.0 client proc Trap exit signal such that terminate/3 gets executed so that the socket is closed cleanly. (cherry picked from commit 3daef04566dba770e40164008792def51ea5f4b6) --- deps/amqp10_client/src/amqp10_client_frame_reader.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/deps/amqp10_client/src/amqp10_client_frame_reader.erl b/deps/amqp10_client/src/amqp10_client_frame_reader.erl index c54fa9aadd4d..9a2f114c90e7 100644 --- a/deps/amqp10_client/src/amqp10_client_frame_reader.erl +++ b/deps/amqp10_client/src/amqp10_client_frame_reader.erl @@ -80,6 +80,7 @@ callback_mode() -> [handle_event_function]. init([Sup, ConnConfig]) when is_map(ConnConfig) -> + process_flag(trap_exit, true), Port = maps:get(port, ConnConfig, 5672), %% combined the list of `addresses' with the value of the original `address' option if provided Addresses0 = maps:get(addresses, ConnConfig, []),