@@ -1876,7 +1876,7 @@ queue_down_consumer_action(CTag, CMap) ->
18761876 _ -> {recover , ConsumeSpec }
18771877 end .
18781878
1879- binding_action (Fun , SourceNameBin0 , DestinationType , DestinationNameBin0 ,
1879+ binding_action (Action , SourceNameBin0 , DestinationType , DestinationNameBin0 ,
18801880 RoutingKey , Arguments , VHostPath , ConnPid , AuthzContext ,
18811881 # user {username = Username } = User ) ->
18821882 ExchangeNameBin = strip_cr_lf (SourceNameBin0 ),
@@ -1892,10 +1892,10 @@ binding_action(Fun, SourceNameBin0, DestinationType, DestinationNameBin0,
18921892 {ok , Exchange } ->
18931893 check_read_permitted_on_topic (Exchange , User , RoutingKey , AuthzContext )
18941894 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 },
18991899 fun (_X , Q ) when ? is_amqqueue (Q ) ->
19001900 try rabbit_amqqueue :check_exclusive_access (Q , ConnPid )
19011901 catch exit :Reason -> {error , Reason }
@@ -1912,6 +1912,9 @@ binding_action(Fun, SourceNameBin0, DestinationType, DestinationNameBin0,
19121912 rabbit_misc :protocol_error (precondition_failed , Fmt , Args );
19131913 {error , # amqp_error {} = Error } ->
19141914 rabbit_misc :protocol_error (Error );
1915+ {error , timeout } ->
1916+ rabbit_misc :protocol_error (
1917+ internal_error , " Could not ~s binding due to timeout" , [Action ]);
19151918 ok ->
19161919 ok
19171920 end .
@@ -2381,15 +2384,15 @@ i(Item, _) ->
23812384 throw ({bad_argument , Item }).
23822385
23832386pending_raft_commands (QStates ) ->
2384- Fun = fun (_ , V , Acc ) ->
2387+ Action = fun (_ , V , Acc ) ->
23852388 case rabbit_queue_type :state_info (V ) of
23862389 #{pending_raft_commands := P } ->
23872390 Acc + P ;
23882391 _ ->
23892392 Acc
23902393 end
23912394 end ,
2392- rabbit_queue_type :fold_state (Fun , 0 , QStates ).
2395+ rabbit_queue_type :fold_state (Action , 0 , QStates ).
23932396
23942397name (# ch {cfg = # conf {conn_name = ConnName , channel = Channel }}) ->
23952398 list_to_binary (rabbit_misc :format (" ~ts (~tp )" , [ConnName , Channel ])).
@@ -2441,31 +2444,31 @@ handle_method(#'exchange.bind'{destination = DestinationNameBin,
24412444 routing_key = RoutingKey ,
24422445 arguments = Arguments },
24432446 ConnPid , AuthzContext , _CollectorId , VHostPath , User ) ->
2444- binding_action (fun rabbit_binding : add / 3 ,
2447+ binding_action (add ,
24452448 SourceNameBin , exchange , DestinationNameBin ,
24462449 RoutingKey , Arguments , VHostPath , ConnPid , AuthzContext , User );
24472450handle_method (# 'exchange.unbind' {destination = DestinationNameBin ,
24482451 source = SourceNameBin ,
24492452 routing_key = RoutingKey ,
24502453 arguments = Arguments },
24512454 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 );
24552458handle_method (# 'queue.unbind' {queue = QueueNameBin ,
24562459 exchange = ExchangeNameBin ,
24572460 routing_key = RoutingKey ,
24582461 arguments = Arguments },
24592462 ConnPid , AuthzContext , _CollectorId , VHostPath , User ) ->
2460- binding_action (fun rabbit_binding : remove / 3 ,
2463+ binding_action (remove ,
24612464 ExchangeNameBin , queue , QueueNameBin ,
24622465 RoutingKey , Arguments , VHostPath , ConnPid , AuthzContext , User );
24632466handle_method (# 'queue.bind' {queue = QueueNameBin ,
24642467 exchange = ExchangeNameBin ,
24652468 routing_key = RoutingKey ,
24662469 arguments = Arguments },
24672470 ConnPid , AuthzContext , _CollectorId , VHostPath , User ) ->
2468- binding_action (fun rabbit_binding : add / 3 ,
2471+ binding_action (add ,
24692472 ExchangeNameBin , queue , QueueNameBin ,
24702473 RoutingKey , Arguments , VHostPath , ConnPid , AuthzContext , User );
24712474% % Note that all declares to these are effectively passive. If it
@@ -2580,12 +2583,12 @@ handle_method(#'queue.declare'{queue = QueueNameBin,
25802583 ConnPid , _AuthzContext , _CollectorPid , VHostPath , _User ) ->
25812584 StrippedQueueNameBin = strip_cr_lf (QueueNameBin ),
25822585 QueueName = rabbit_misc :r (VHostPath , queue , StrippedQueueNameBin ),
2583- Fun = fun (Q0 ) ->
2586+ Action = fun (Q0 ) ->
25842587 QStat = maybe_stat (NoWait , Q0 ),
25852588 {QStat , Q0 }
25862589 end ,
25872590 % % 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 ),
25892592 ok = rabbit_amqqueue :check_exclusive_access (Q , ConnPid ),
25902593 {ok , QueueName , MessageCount , ConsumerCount };
25912594handle_method (# 'queue.delete' {queue = QueueNameBin ,
0 commit comments