-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Pyamqp] Revert back to websocket-client #26787
[Pyamqp] Revert back to websocket-client #26787
Conversation
/azp run python - eventhub - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -149,6 +149,36 @@ async def send_frame(self, channel, frame, **kwargs): | |||
await self.write(data) | |||
# _LOGGER.info("OCH%d -> %r", channel, frame) | |||
|
|||
class AsyncTransport( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we copy changes to SB pyamqp as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes these changes will have to go back there too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I meant can you copy them over in this PR? 🙂
or do we want to do that later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol my reply wasnt clear, Ill do it in this PR itself :)
|
||
async def _read(self, n, buffer=None, **kwargs): # pylint: disable=unused-argument | ||
async def _read(self, n, buffer=None, **kwargs): # pylint: disable=unused-arguments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be a typo and need to be
async def _read(self, n, buffer=None, **kwargs): # pylint: disable=unused-arguments | |
async def _read(self, n, buffer=None, **kwargs): # pylint: disable=unused-argument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this will be a lot of work, but would you be able to compare with the sync transport/websocket to see if there were changes that need to be copied over here? I think I may have added some mypy/pylint things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a lot of work, I just brought in the old WebSocketTransportAsync
and the current portions untouched. Any re-shuffling will keep all the pylint/mypy work. Will take a look at the WebSocketTransportAsync
though
API change check APIView has identified API level changes in this PR and created following API reviews. |
/azp run python - eventhub - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - eventhub - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - eventhub - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - eventhub - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - eventhub - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Due to issues with running websocket-client in async mode, we decided to stay with aiohttp for async. We were able to use heartbeat from aiohttp and timeouts to mitigate the bugs. |
@kashifkhan im having the same issue, can you elaborate on what you did with aiohttp, which timeouts did you use? |
@gil-cohen I passed in heartbeat parameter in ws_connect with a value of 10 seconds. That was enough time for the library to determine that the underlying connection has been lost. Additionally you can take a look at these 2 PRs where you can see the changes and some of the exceptions that I am now addressing #26856 |
aiohttp websocket has 2 bugs when a connection is abruptly cut:
websocket send does not throw an exception -> issue -> known since 2017
websocket receive gets stuck if network is suddenly disconnected -> PR -> unmerged since July 2021
Reverting back to websocket-client in async as that is what most are using. There is another async websocket client but it doesnt support proxies.