Codecov-python occasionally unable to upload coverage data - IncompleteRead or "max retries exceeded"

Description

As of recently, we have had numerous failed attempts to upload coverage from Azure Pipelines. This causes all PRs to be red as a lot of files have “unexpected changes”.

There are two errors that we see repeatedly:

Error:‌ HTTPSConnectionPool(host='codecov.io', port=443): Max retries exceeded with url: /codecov/v4/raw/2019-07-12/C955722FF6CB945C7FBFFBD7519DCB1E/47302ae1b5db000b24037497b2e16d06416d35f1/92218a2d-2fe8-4676-b1b1-c676e4986bf8.txt?AWSAccessKeyId=AKIAIHLZSCQCS4WIHD4A&Expires=1562967926&Signature=e3d0I4%2Bxob52YQMPs1oc4YljoF4%3D (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x03D1E710>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))‌
Error:‌ ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))‌

Repository

Versions

Browser and OS shouldn’t matter, but Azure is running codecov-python is the latest available with pip.

Additional Information

We have recently moved from Appveyor/Travis/CircleCI to Azure Pipelines and also moved the repository from Valloric/ycmd to ycm-core/ycmd. I don’t think this makes any difference, but it gives the complete picture of what is going on.

More specific data about the latest commit upload failures:

https://codecov.io/gh/ycm-core/ycmd/commit/47302ae1b5db000b24037497b2e16d06416d35f1/build

It is missing two build uploads:

  • Linux Python 2.7 without libclang completer
  • Windows Visual Studio 2019 Python 3.7 32-bit

compared to the second to last master commit:

https://codecov.io/gh/ycm-core/ycmd/commit/de3aab266a6ea0798371631b76d7ac854eae512a/build