This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.64k
stars
2.84k
forks
source link
[ServiceBus] Ensure exceptions are idiomatic, properly named, and non-spurious. #13040
Consider this issue "let's triage any well defined exception oddities we've found." An (incomplete) list below:
[x] Mode being passed as wrong type should be a TypeError (MessageHandlerError out of UAMQP)
[x] should (do?) all custom exception types have the ServiceBus* prefix?
[x] VendorLinkDetatch failures when terminating SessionPool samples
Traceback (most recent call last):
File "C:\Users\kibrantn\Source\Repos\azure-sdk-for-python-kibrantn\sdk\servicebus\azure-servicebus\azure\servicebus\aio\_base_handler_async.py", line 118, in _do_retryable_operation
return await operation(**kwargs)
File "C:\Users\kibrantn\Source\Repos\azure-sdk-for-python-kibrantn\sdk\servicebus\azure-servicebus\azure\servicebus\aio\_servicebus_receiver_async.py", line 169, in _open
while not await self._handler.client_ready_async():
File "C:\Users\kibrantn\Source\Repos\azure-sdk-for-python-kibrantn\sdk\servicebus\sb_t2_env\lib\site-packages\uamqp\async_ops\client_async.py", line 362, in client_ready_async
if not await self._client_ready_async():
File "C:\Users\kibrantn\Source\Repos\azure-sdk-for-python-kibrantn\sdk\servicebus\sb_t2_env\lib\site-packages\uamqp\async_ops\client_async.py", line 817, in _client_ready_async
if self.message_handler.get_state() == constants.MessageReceiverState.Error:
File "C:\Users\kibrantn\Source\Repos\azure-sdk-for-python-kibrantn\sdk\servicebus\sb_t2_env\lib\site-packages\uamqp\receiver.py", line 262, in get_state
raise self._error
uamqp.errors.LinkDetach: ErrorCodes.NotAllowed: A sessionful message receiver cannot be created on an entity that does not require sessions. Ensure RequiresSession is set to true when creating a Queue or Subscription to enable sessionful behavior. TrackingId:4fd16b9a-30a9-4115-93ad-3ebbdf9e921d_B18, SystemTracker:kibrantn-azure-sdk-test:Queue:test, Timestamp:2020-05-01T05:49:40 TrackingId:7bf09bd4b08142a4baef26ad2ac9104a_G27, SystemTracker:gateway7, Timestamp:2020-05-01T05:49:40
Design discussion was had regarding these signatures, we're apt to add a prefix for items where cross-SDK verbiage exists (ala MessageError). Task has been created to do this work Here.
Problem diagnosed, intentional design choice in UAMQP to log this as warning. Proposed solution is a "known vendor failures" parameter to allow callers to declare certain failures not-needing-to-be-warned if they're handled or understood in the caller context. Task has been created within UAMQP here.
Consider this issue "let's triage any well defined exception oddities we've found." An (incomplete) list below: