@@ -535,11 +535,10 @@ open(info,
535
535
name = ConnectionName ,
536
536
credits = Credits ,
537
537
heartbeater = Heartbeater
538
- } = Connection0 ,
538
+ } = Connection ,
539
539
connection_state = # stream_connection_state {blocked = Blocked } = State ,
540
540
config = # configuration {credits_required_for_unblocking = CreditsRequiredForUnblocking }
541
541
} = StatemData ) ->
542
- Connection = ensure_stats_timer (Connection0 ),
543
542
rabbit_log_connection :debug (" Connection ~p received resource alarm. Alarm "
544
543
" on? ~p " ,
545
544
[ConnectionName , IsThereAlarm ]),
@@ -581,12 +580,11 @@ open(info,
581
580
connection = # stream_connection {socket = S ,
582
581
credits = Credits ,
583
582
heartbeater = Heartbeater
584
- } = Connection0 ,
583
+ } = Connection ,
585
584
connection_state = # stream_connection_state {blocked = Blocked } = State ,
586
585
config = Configuration
587
586
} = StatemData )
588
587
when OK =:= tcp ; OK =:= ssl ->
589
- Connection = ensure_stats_timer (Connection0 ),
590
588
{Connection1 , State1 } = handle_inbound_data_post_auth (Transport ,
591
589
Connection ,
592
590
State ,
@@ -662,10 +660,9 @@ open(info,
662
660
transport = Transport ,
663
661
connection = # stream_connection {socket = S ,
664
662
monitors = Monitors
665
- } = Connection0 ,
663
+ } = Connection ,
666
664
connection_state = State
667
665
} = StatemData ) ->
668
- Connection = ensure_stats_timer (Connection0 ),
669
666
{Connection1 , State1 } =
670
667
case Monitors of
671
668
#{MonitorRef := Stream } ->
@@ -764,13 +761,12 @@ open(cast,
764
761
credits = Credits ,
765
762
heartbeater = Heartbeater ,
766
763
publishers = Publishers
767
- } = Connection0 ,
764
+ } = Connection ,
768
765
connection_state = # stream_connection_state {
769
766
blocked = Blocked
770
767
} = State ,
771
768
config = Configuration
772
769
} = StatemData ) ->
773
- Connection = ensure_stats_timer (Connection0 ),
774
770
ByPublisher =
775
771
lists :foldr (fun ({PublisherId , PublishingId }, Acc ) ->
776
772
case maps :get (PublisherId , Acc , undefined ) of
@@ -820,13 +816,12 @@ open(cast,
820
816
heartbeater = Heartbeater ,
821
817
publishers = Publishers ,
822
818
publisher_to_ids = PublisherRefToIds
823
- } = Connection0 ,
819
+ } = Connection ,
824
820
connection_state = # stream_connection_state {
825
821
blocked = Blocked
826
822
} = State ,
827
823
config = Configuration
828
824
} = StatemData ) ->
829
- Connection = ensure_stats_timer (Connection0 ),
830
825
% % FIXME handle case when publisher ID is not found (e.g. deleted before confirms arrive)
831
826
PublisherId =
832
827
maps :get ({Stream , PublisherReference }, PublisherRefToIds ,
@@ -867,11 +862,10 @@ open(cast,
867
862
connection = # stream_connection {
868
863
stream_subscriptions = StreamSubscriptions ,
869
864
send_file_oct = SendFileOct
870
- } = Connection0 ,
865
+ } = Connection ,
871
866
connection_state = # stream_connection_state {consumers = Consumers } = State
872
867
} = StatemData )
873
868
when Offset > - 1 ->
874
- Connection = ensure_stats_timer (Connection0 ),
875
869
{Connection1 , State1 } =
876
870
case maps :get (StreamName , StreamSubscriptions , undefined ) of
877
871
undefined ->
@@ -930,9 +924,8 @@ open(cast,
930
924
connection = Connection1 ,
931
925
connection_state = State1 }};
932
926
open (cast , {force_event_refresh , Ref }, # statem_data {
933
- connection = Connection0 ,
927
+ connection = Connection ,
934
928
connection_state = State } = StatemData ) ->
935
- Connection = ensure_stats_timer (Connection0 ),
936
929
Infos =
937
930
augment_infos_with_user_provided_connection_name (infos (? CREATION_EVENT_KEYS ,
938
931
Connection ,
@@ -942,7 +935,8 @@ open(cast, {force_event_refresh, Ref}, #statem_data{
942
935
Connection1 =
943
936
rabbit_event :init_stats_timer (Connection ,
944
937
# stream_connection .stats_timer ),
945
- {keep_state , StatemData # statem_data {connection = Connection1 }}.
938
+ Connection2 = ensure_stats_timer (Connection1 ),
939
+ {keep_state , StatemData # statem_data {connection = Connection2 }}.
946
940
947
941
close_sent (info , {tcp , S , Data }, # statem_data {
948
942
transport = Transport ,
0 commit comments