@@ -1876,7 +1876,7 @@ queue_down_consumer_action(CTag, CMap) ->
1876
1876
_ -> {recover , ConsumeSpec }
1877
1877
end .
1878
1878
1879
- binding_action (Fun , SourceNameBin0 , DestinationType , DestinationNameBin0 ,
1879
+ binding_action (Action , SourceNameBin0 , DestinationType , DestinationNameBin0 ,
1880
1880
RoutingKey , Arguments , VHostPath , ConnPid , AuthzContext ,
1881
1881
# user {username = Username } = User ) ->
1882
1882
ExchangeNameBin = strip_cr_lf (SourceNameBin0 ),
@@ -1892,10 +1892,10 @@ binding_action(Fun, SourceNameBin0, DestinationType, DestinationNameBin0,
1892
1892
{ok , Exchange } ->
1893
1893
check_read_permitted_on_topic (Exchange , User , RoutingKey , AuthzContext )
1894
1894
end ,
1895
- case Fun (# binding {source = ExchangeName ,
1896
- destination = DestinationName ,
1897
- key = RoutingKey ,
1898
- args = Arguments },
1895
+ case rabbit_binding : Action (# binding {source = ExchangeName ,
1896
+ destination = DestinationName ,
1897
+ key = RoutingKey ,
1898
+ args = Arguments },
1899
1899
fun (_X , Q ) when ? is_amqqueue (Q ) ->
1900
1900
try rabbit_amqqueue :check_exclusive_access (Q , ConnPid )
1901
1901
catch exit :Reason -> {error , Reason }
@@ -1912,6 +1912,9 @@ binding_action(Fun, SourceNameBin0, DestinationType, DestinationNameBin0,
1912
1912
rabbit_misc :protocol_error (precondition_failed , Fmt , Args );
1913
1913
{error , # amqp_error {} = Error } ->
1914
1914
rabbit_misc :protocol_error (Error );
1915
+ {error , timeout } ->
1916
+ rabbit_misc :protocol_error (
1917
+ internal_error , " Could not ~s binding due to timeout" , [Action ]);
1915
1918
ok ->
1916
1919
ok
1917
1920
end .
@@ -2381,15 +2384,15 @@ i(Item, _) ->
2381
2384
throw ({bad_argument , Item }).
2382
2385
2383
2386
pending_raft_commands (QStates ) ->
2384
- Fun = fun (_ , V , Acc ) ->
2387
+ Action = fun (_ , V , Acc ) ->
2385
2388
case rabbit_queue_type :state_info (V ) of
2386
2389
#{pending_raft_commands := P } ->
2387
2390
Acc + P ;
2388
2391
_ ->
2389
2392
Acc
2390
2393
end
2391
2394
end ,
2392
- rabbit_queue_type :fold_state (Fun , 0 , QStates ).
2395
+ rabbit_queue_type :fold_state (Action , 0 , QStates ).
2393
2396
2394
2397
name (# ch {cfg = # conf {conn_name = ConnName , channel = Channel }}) ->
2395
2398
list_to_binary (rabbit_misc :format (" ~ts (~tp )" , [ConnName , Channel ])).
@@ -2441,31 +2444,31 @@ handle_method(#'exchange.bind'{destination = DestinationNameBin,
2441
2444
routing_key = RoutingKey ,
2442
2445
arguments = Arguments },
2443
2446
ConnPid , AuthzContext , _CollectorId , VHostPath , User ) ->
2444
- binding_action (fun rabbit_binding : add / 3 ,
2447
+ binding_action (add ,
2445
2448
SourceNameBin , exchange , DestinationNameBin ,
2446
2449
RoutingKey , Arguments , VHostPath , ConnPid , AuthzContext , User );
2447
2450
handle_method (# 'exchange.unbind' {destination = DestinationNameBin ,
2448
2451
source = SourceNameBin ,
2449
2452
routing_key = RoutingKey ,
2450
2453
arguments = Arguments },
2451
2454
ConnPid , AuthzContext , _CollectorId , VHostPath , User ) ->
2452
- binding_action (fun rabbit_binding : remove / 3 ,
2453
- SourceNameBin , exchange , DestinationNameBin ,
2454
- RoutingKey , Arguments , VHostPath , ConnPid , AuthzContext , User );
2455
+ binding_action (remove ,
2456
+ SourceNameBin , exchange , DestinationNameBin ,
2457
+ RoutingKey , Arguments , VHostPath , ConnPid , AuthzContext , User );
2455
2458
handle_method (# 'queue.unbind' {queue = QueueNameBin ,
2456
2459
exchange = ExchangeNameBin ,
2457
2460
routing_key = RoutingKey ,
2458
2461
arguments = Arguments },
2459
2462
ConnPid , AuthzContext , _CollectorId , VHostPath , User ) ->
2460
- binding_action (fun rabbit_binding : remove / 3 ,
2463
+ binding_action (remove ,
2461
2464
ExchangeNameBin , queue , QueueNameBin ,
2462
2465
RoutingKey , Arguments , VHostPath , ConnPid , AuthzContext , User );
2463
2466
handle_method (# 'queue.bind' {queue = QueueNameBin ,
2464
2467
exchange = ExchangeNameBin ,
2465
2468
routing_key = RoutingKey ,
2466
2469
arguments = Arguments },
2467
2470
ConnPid , AuthzContext , _CollectorId , VHostPath , User ) ->
2468
- binding_action (fun rabbit_binding : add / 3 ,
2471
+ binding_action (add ,
2469
2472
ExchangeNameBin , queue , QueueNameBin ,
2470
2473
RoutingKey , Arguments , VHostPath , ConnPid , AuthzContext , User );
2471
2474
% % Note that all declares to these are effectively passive. If it
@@ -2580,12 +2583,12 @@ handle_method(#'queue.declare'{queue = QueueNameBin,
2580
2583
ConnPid , _AuthzContext , _CollectorPid , VHostPath , _User ) ->
2581
2584
StrippedQueueNameBin = strip_cr_lf (QueueNameBin ),
2582
2585
QueueName = rabbit_misc :r (VHostPath , queue , StrippedQueueNameBin ),
2583
- Fun = fun (Q0 ) ->
2586
+ Action = fun (Q0 ) ->
2584
2587
QStat = maybe_stat (NoWait , Q0 ),
2585
2588
{QStat , Q0 }
2586
2589
end ,
2587
2590
% % Note: no need to check if Q is an #amqqueue, with_or_die does it
2588
- {{ok , MessageCount , ConsumerCount }, Q } = rabbit_amqqueue :with_or_die (QueueName , Fun ),
2591
+ {{ok , MessageCount , ConsumerCount }, Q } = rabbit_amqqueue :with_or_die (QueueName , Action ),
2589
2592
ok = rabbit_amqqueue :check_exclusive_access (Q , ConnPid ),
2590
2593
{ok , QueueName , MessageCount , ConsumerCount };
2591
2594
handle_method (# 'queue.delete' {queue = QueueNameBin ,
0 commit comments