9
9
% % The Original Code is RabbitMQ.
10
10
% %
11
11
% % The Initial Developer of the Original Code is Pivotal Software, Inc.
12
- % % Copyright (c) 2020-2024 Broadcom. All Rights Reserved.
12
+ % % Copyright (c) 2020-2025 Broadcom. All Rights Reserved.
13
13
% % The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
14
14
% %
15
15
@@ -2249,7 +2249,7 @@ handle_frame_post_auth(Transport,
2249
2249
{Connection , State };
2250
2250
true ->
2251
2251
{Connection1 , State1 } =
2252
- remove_subscription (SubscriptionId , Connection , State ),
2252
+ remove_subscription (SubscriptionId , Connection , State , true ),
2253
2253
response_ok (Transport , Connection , unsubscribe , CorrelationId ),
2254
2254
{Connection1 , State1 }
2255
2255
end ;
@@ -3081,7 +3081,7 @@ evaluate_state_after_secret_update(Transport,
3081
3081
_ ->
3082
3082
{C1 , S1 } =
3083
3083
lists :foldl (fun (SubId , {Conn , St }) ->
3084
- remove_subscription (SubId , Conn , St )
3084
+ remove_subscription (SubId , Conn , St , false )
3085
3085
end , {C0 , S0 }, Subs ),
3086
3086
{Acc #{Str => ok }, C1 , S1 }
3087
3087
end
@@ -3216,7 +3216,8 @@ notify_connection_closed(#statem_data{connection =
3216
3216
ConnectionState }) ->
3217
3217
rabbit_core_metrics :connection_closed (self ()),
3218
3218
[rabbit_stream_metrics :consumer_cancelled (self (),
3219
- stream_r (S , Connection ), SubId )
3219
+ stream_r (S , Connection ),
3220
+ SubId , false )
3220
3221
|| # consumer {configuration =
3221
3222
# consumer_configuration {stream = S ,
3222
3223
subscription_id = SubId }}
@@ -3304,7 +3305,8 @@ clean_state_after_stream_deletion_or_failure(MemberPid, Stream,
3304
3305
rabbit_stream_metrics :consumer_cancelled (self (),
3305
3306
stream_r (Stream ,
3306
3307
C0 ),
3307
- SubId ),
3308
+ SubId ,
3309
+ false ),
3308
3310
maybe_unregister_consumer (
3309
3311
VirtualHost , Consumer ,
3310
3312
single_active_consumer (Consumer ),
@@ -3314,7 +3316,8 @@ clean_state_after_stream_deletion_or_failure(MemberPid, Stream,
3314
3316
rabbit_stream_metrics :consumer_cancelled (self (),
3315
3317
stream_r (Stream ,
3316
3318
C0 ),
3317
- SubId ),
3319
+ SubId ,
3320
+ false ),
3318
3321
maybe_unregister_consumer (
3319
3322
VirtualHost , Consumer ,
3320
3323
single_active_consumer (Consumer ),
@@ -3431,7 +3434,8 @@ remove_subscription(SubscriptionId,
3431
3434
stream_subscriptions =
3432
3435
StreamSubscriptions } =
3433
3436
Connection ,
3434
- # stream_connection_state {consumers = Consumers } = State ) ->
3437
+ # stream_connection_state {consumers = Consumers } = State ,
3438
+ Notify ) ->
3435
3439
#{SubscriptionId := Consumer } = Consumers ,
3436
3440
# consumer {log = Log ,
3437
3441
configuration = # consumer_configuration {stream = Stream , member_pid = MemberPid }} =
@@ -3457,7 +3461,8 @@ remove_subscription(SubscriptionId,
3457
3461
Connection2 = maybe_clean_connection_from_stream (MemberPid , Stream , Connection1 ),
3458
3462
rabbit_stream_metrics :consumer_cancelled (self (),
3459
3463
stream_r (Stream , Connection2 ),
3460
- SubscriptionId ),
3464
+ SubscriptionId ,
3465
+ Notify ),
3461
3466
3462
3467
Requests1 = maybe_unregister_consumer (
3463
3468
VirtualHost , Consumer ,
0 commit comments