@@ -909,7 +909,7 @@ binding_action(Fun, ExchangeNameBin, QueueNameBin, RoutingKey, Arguments,
909909 State ),
910910 ExchangeName = rabbit_misc :r (VHostPath , exchange , ExchangeNameBin ),
911911 check_read_permitted (ExchangeName , State ),
912- case Fun (ExchangeName , QueueName , ActualRoutingKey , Arguments ,
912+ case catch Fun (ExchangeName , QueueName , ActualRoutingKey , Arguments ,
913913 fun (_X , Q ) ->
914914 rabbit_amqqueue :check_exclusive_access (Q , ReaderPid )
915915 end ) of
@@ -926,6 +926,11 @@ binding_action(Fun, ExchangeNameBin, QueueNameBin, RoutingKey, Arguments,
926926 not_found , " no binding ~s between ~s and ~s " ,
927927 [RoutingKey , rabbit_misc :rs (ExchangeName ),
928928 rabbit_misc :rs (QueueName )]);
929+ % % When check_exclusive_access exits with a protocal error this gets
930+ % % wrapped because rabbit_misc:execute_mnesia_transaction uses the
931+ % % worker pool. Unwrap it and exit again.
932+ {error , {amqp_error , _ , _ , _ } = Error } ->
933+ exit (Error );
929934 ok -> return_ok (State , NoWait , ReturnMethod )
930935 end .
931936
0 commit comments