Visitar URL original
bpo-40352: Try to reconnect socket when send message in SocketHandler. by serhiy-storchaka · Pull Request #22061 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20250609154210/https://github.com/python/cpython/pull/22061
Skip to content

bpo-40352: Try to reconnect socket when send message in SocketHandler. #22061

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

Closed

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Sep 2, 2020 •

TODO: Tests and NEWS.

https://bugs.python.org/issue40352

try:
self.sock.sendall(s)
except OSError: #pragma: no cover
self.sock.close()
self.sock = None # so we can call createSocket next time
if attempt:
continue
break
Copy link
Member

Choose a reason for hiding this comment

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

IIUC, this code will retry connection once, straight away, if the handler was previously connected but an error occurs when actually sending the event. In the case where the reason for the error is that the remote has gone offline, how likely is that reconnection attempt to succeed? Isn't the remote going offline for a period the case described in the issue?

@ambv ambv removed the needs backport to 3.9 only security fixes label May 17, 2022
@ambv
Copy link
Contributor

ambv commented May 17, 2022

This missed the boat for inclusion in Python 3.9 which accepts security fixes only as of today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants