Azure / azure-sdk-for-python

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.63k stars 2.84k forks source link

[AMQP Python] Async race condition when connection/session/link shared #22973

Closed yunhaoling closed 8 months ago

yunhaoling commented 2 years ago

https://github.com/Azure/azure-uamqp-python/pull/283#discussion_r797049404

On another note - we had talked about making Connection/Session/Link objects threadsafe - this will also apply to concurrency-safe. Wherever we are using aynscio.gather - each of those Sessions/Links are behaving concurrently - which could lead to race conditions if they do anything to modify their parent (e.g. if one link errors and updates the session state, a concurrent link might try to set a conflicting session state). So we may need to revisit those discussions in this context.

so far the async implementation is not using asyncio.gather for Mutiple sessions/links. The implementation strategy in pyamqp is still the same as the uamqp one, we assume one sender/receiver will own a single conneciton/session/link. The async implementation is pretty similar to the sync version in which we do a for loop and raise on the first error we encountered.

however, if we want to connection/session sharing among multiple senders and receivers, we need to take the concurrency into account.

github-actions[bot] commented 8 months ago

Hi @yunhaoling, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.