GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — http.py should catch more ECONNRESET conditions · Issue #1146 · googleapis/google-api-python-client

http.py should catch more ECONNRESET conditions #1146

New issue
Copy link
New issue
Copy link
Closed
#1147
Closed
http.py should catch more ECONNRESET conditions#1146
#1147
Copy link
Assignees
parthea
Labels
type: cleanupAn internal cleanup or hygiene concern.

Description

@dossett
dossett
opened on Dec 23, 2020
Issue body actions

Right now http.py implicitly assumes that an ECONNRESET error will be raised as a ConnectionError. However, in some cases urllib3 will raise this a regular OSError with the ernno set to match ECONNRESET. http.py should check for the errnos that correspond to the subclasses of ConnectionError to be extra safe.

Activity

  1. dossett commented on Dec 23, 2020

    @dossett
    dossett
    on Dec 23, 2020
    ContributorAuthor
    More actions

    Here's an example spotted in the wild, the ECONNRESET is thrown as a SocketError, i.e. an OSError, not a ConnectionError.

    File "/usr/local/lib/python3.7/site-packages/googleapiclient/http.py", line 901, in execute
         headers=self.headers,
       File "/usr/local/lib/python3.7/site-packages/googleapiclient/http.py", line 177, in _retry_request
         resp, content = http.request(uri, method, *args, **kwargs)
       File "/usr/local/lib/python3.7/site-packages/google_auth_httplib2.py", line 198, in request
         uri, method, body=body, headers=request_headers, **kwargs)
       File "/usr/local/lib/python3.7/site-packages/httplib2/__init__.py", line 1314, in request
         (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
       File "/usr/local/lib/python3.7/site-packages/httplib2/__init__.py", line 1064, in _request
         (response, content) = self._conn_request(conn, request_uri, method, body, headers)
       File "/usr/local/lib/python3.7/site-packages/httplib2shim/__init__.py", line 154, in _conn_request
         raise _map_exception(e)
       File "/usr/local/lib/python3.7/site-packages/httplib2shim/__init__.py", line 148, in _conn_request
         decode_content=decode)
       File "/usr/local/lib/python3.7/site-packages/urllib3/request.py", line 68, in request
         **urlopen_kw)
       File "/usr/local/lib/python3.7/site-packages/urllib3/request.py", line 89, in request_encode_url
         return self.urlopen(method, url, **extra_kw)
       File "/usr/local/lib/python3.7/site-packages/urllib3/poolmanager.py", line 326, in urlopen
         response = conn.urlopen(method, u.request_uri, **kw)
       File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 641, in urlopen
         _stacktrace=sys.exc_info()[2])
       File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 344, in increment
         raise six.reraise(type(error), error, _stacktrace)
       File "/usr/local/lib/python3.7/site-packages/urllib3/packages/six.py", line 685, in reraise
         raise value.with_traceback(tb)
       File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 603, in urlopen
         chunked=chunked)
       File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
         six.raise_from(e, None)
       File "<string>", line 2, in raise_from
       File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 383, in _make_request
         httplib_response = conn.getresponse()
       File "/usr/local/lib/python3.7/http/client.py", line 1344, in getresponse
         response.begin()
       File "/usr/local/lib/python3.7/http/client.py", line 306, in begin
         version, status, reason = self._read_status()
       File "/usr/local/lib/python3.7/http/client.py", line 267, in _read_status
         line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
       File "/usr/local/lib/python3.7/socket.py", line 589, in readinto
         return self._sock.recv_into(b)
       File "/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 309, in recv_into
         raise SocketError(str(e))
     urllib3.exceptions.ProtocolError: ('Connection aborted.', OSError("(104, 'ECONNRESET')"))
    
  2. busunkim96
    added
    type: cleanupAn internal cleanup or hygiene concern.
    on Dec 24, 2020
  3. busunkim96
    assigned
    parthea
    on Dec 24, 2020
  4. gcf-merge-on-green
    added a commit that references this issue on Jan 13, 2021

    fix: Catch ECONNRESET and other errors more reliably (#1147)

    This issue will close once commit ae9cd99 is merged into the 'main' branch.
    ae9cd99
  5. gcf-merge-on-green
    closed this as completedin #1147on Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @parthea
    parthea

Labels

type: cleanupAn internal cleanup or hygiene concern.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.