Skip to content

Commit

Permalink
[wptserve] Don't log SSLEOFError, SSLError, OSError on startup.
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D202704

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1882039
gecko-commit: b74ae2aeca28af97283f838bfef995a3976af81a
  • Loading branch information
moz-wptsync-bot committed Feb 28, 2024
1 parent cc8c736 commit ab704d1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tools/wptserve/wptserve/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ def rewrite(self, request_handler):

class WebTestServer(http.server.ThreadingHTTPServer):
allow_reuse_address = True
acceptable_errors = (errno.EPIPE, errno.ECONNABORTED)
# Older versions of Python might throw `OSError: [Errno 0] Error`
# instead of `SSLEOFError`.
acceptable_errors = (errno.EPIPE, errno.ECONNABORTED, 0)
request_queue_size = 2000

# Ensure that we don't hang on shutdown waiting for requests
Expand Down Expand Up @@ -237,10 +239,10 @@ def handle_error(self, request, client_address):
error.args[0] in self.acceptable_errors) or
(isinstance(error, IOError) and
error.errno in self.acceptable_errors) or
# `SSLEOFError` may occur when a client (e.g., wptrunner's
# `TestEnvironment`) tests for connectivity but doesn't perform the
# handshake.
isinstance(error, ssl.SSLEOFError)):
# `SSLEOFError` and `SSLError` may occur when a client
# (e.g., wptrunner's `TestEnvironment`) tests for connectivity
# but doesn't perform the handshake.
isinstance(error, ssl.SSLEOFError) or isinstance(error, ssl.SSLError)):
pass # remote hang up before the result is sent
else:
msg = traceback.format_exc()
Expand Down

0 comments on commit ab704d1

Please sign in to comment.