Skip to content

Don't log OSError in transports #258

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

Merged
merged 1 commit into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion uvloop/handles/basetransport.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cdef class UVBaseTransport(UVSocketHandle):

self._force_close(exc)

if not isinstance(exc, FATAL_SSL_ERROR_IGNORE):
if not isinstance(exc, OSError):

if throw or self._loop is None:
raise exc
Expand Down
2 changes: 1 addition & 1 deletion uvloop/handles/streamserver.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ cdef class UVStreamServer(UVSocketHandle):

self._close()

if not isinstance(exc, FATAL_SSL_ERROR_IGNORE):
if not isinstance(exc, OSError):

if throw or self._loop is None:
raise exc
Expand Down
7 changes: 0 additions & 7 deletions uvloop/includes/stdlib.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,6 @@ cdef int ssl_SSL_ERROR_WANT_READ = ssl.SSL_ERROR_WANT_READ
cdef int ssl_SSL_ERROR_WANT_WRITE = ssl.SSL_ERROR_WANT_WRITE
cdef int ssl_SSL_ERROR_SYSCALL = ssl.SSL_ERROR_SYSCALL

cdef FATAL_SSL_ERROR_IGNORE = (
BrokenPipeError,
ConnectionResetError,
ConnectionAbortedError,
ssl.CertificateError,
)

cdef uint64_t MAIN_THREAD_ID = <uint64_t><int64_t>threading.main_thread().ident

cdef int subprocess_PIPE = subprocess.PIPE
Expand Down
2 changes: 1 addition & 1 deletion uvloop/sslproto.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ cdef class SSLProtocol:
if self._transport:
self._transport._force_close(exc)

if isinstance(exc, FATAL_SSL_ERROR_IGNORE):
if isinstance(exc, OSError):
if self._loop.get_debug():
aio_logger.debug("%r: %s", self, message, exc_info=True)
elif not isinstance(exc, aio_CancelledError):
Expand Down