@@ -121,13 +121,7 @@ terminate() ->
121121 ok .
122122
123123connection_created (Pid , Infos0 ) ->
124- % % Note: authz_backends is added in rabbit_amqp1_0_session_sup:adapter_info/3
125- % % We delete it here, if present, because it should not be stored in the
126- % % connection_created table.
127- % %
128- % % TODO @ansd this will no longer be necessary once this PR is merged:
129- % % https://github.com/rabbitmq/rabbitmq-server/pull/9022
130- Infos1 = proplists :delete (authz_backends , Infos0 ),
124+ Infos1 = maybe_cleanup_infos (Infos0 ),
131125 ets :insert (connection_created , {Pid , Infos1 }),
132126 ets :update_counter (connection_churn_metrics , node (), {2 , 1 },
133127 ? CONNECTION_CHURN_METRICS ),
@@ -453,3 +447,14 @@ format_auth_attempt({{RemoteAddress, Username, Protocol}, Total, Succeeded, Fail
453447format_auth_attempt ({Protocol , Total , Succeeded , Failed }) ->
454448 [{protocol , atom_to_binary (Protocol , utf8 )}, {auth_attempts , Total },
455449 {auth_attempts_failed , Failed }, {auth_attempts_succeeded , Succeeded }].
450+
451+ maybe_cleanup_infos (Infos0 ) when is_list (Infos0 ) ->
452+ % % Note: authz_backends is added in rabbit_amqp1_0_session_sup:adapter_info/3
453+ % % We delete it here, if present, because it should not be stored in the
454+ % % connection_created table.
455+ % %
456+ % % TODO @ansd this will no longer be necessary once this PR is merged:
457+ % % https://github.com/rabbitmq/rabbitmq-server/pull/9022
458+ proplists :delete (authz_backends , Infos0 );
459+ maybe_cleanup_infos (Infos ) ->
460+ Infos .
0 commit comments