Skip to content
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] Possible solutions for network disruption using async websocket #26856

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ async def connect(self):
proxy=http_proxy_host,
proxy_auth=http_proxy_auth,
ssl=self.sslopts,
heartbeat=self._connect_timeout
)
self.connected = True

Expand All @@ -505,7 +506,7 @@ async def _read(self, n, buffer=None, **kwargs): # pylint: disable=unused-argum

try:
while n:
data = await self.ws.receive_bytes()
data = await self.ws.receive_bytes(timeout=self._connect_timeout * 2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we put a big inline comment describing this (and the heartbeat config above) - maybe with a link to the open aiohttp issue that we are waiting on to be resolved?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in a block comment and remove this particular mitigation. Receives tend to time out rather quickly as it is, so no need to constrain it manually.

if len(data) <= n:
view[length : length + len(data)] = data
n -= len(data)
Expand Down