Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Retry to curl to codecov.io unfortunately #8263

Merged
merged 2 commits into from
Feb 13, 2020

Conversation

ryoqun
Copy link
Contributor

@ryoqun ryoqun commented Feb 13, 2020

problem

codecov's infrastracture has severe problem:

ryoqun@ubuqun:~$ while curl -sS --retry-connrefused --retry 10 --retry-delay 2 https://codecov.io/env > /dev/null; do sleep 10; done
curl: (7) Failed to connect to codecov.io port 443: Connection timed out

Ultimately, this causes coverage report upload to fail.

That's because the needed environment variables are not passed to the docker container correctly. This is caused by the silent failure of curl-ing the codecov-provided script.

Usually, docker arguments are populated like this.

solution

Retry very hard.

Even curl --retry isn't enough...

@ryoqun ryoqun added the work in progress This isn't quite right yet label Feb 13, 2020
CODECOV_ENVS=$(CI=true bash <(curl -s https://codecov.io/env))
# Unfortunately, codecov.io fails sometimes:
# curl: (7) Failed to connect to codecov.io port 443: Connection timed out
CODECOV_ENVS=$(CI=true bash <(while ! curl -sS --retry 5 --retry-delay 2 --retry-connrefused https://codecov.io/env; do sleep 10; done))
Copy link
Contributor Author

@ryoqun ryoqun Feb 13, 2020

Choose a reason for hiding this comment

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

Once curl starts to provide --retry-flaky, the while won't be needed.... curl/curl#4558

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Congrats! The upstream curl finally added --retry-all-errors. Still ubuntu haven't updated it even in the groovy release channel, though. We just have to wait more 1.5 years for the next LTS (at least?).

https://curl.haxx.se/changes.html#7_71_0
https://daniel.haxx.se/blog/2020/06/24/curl-7-71-0-blobs-and-retries/
https://curl.haxx.se/docs/manpage.html#--retry-all-errors

CI=true bash <(curl -s https://codecov.io/bash) -X gcov -f target/cov/lcov.info
# Unfortunately, codecov.io fails sometimes:
# curl: (7) Failed to connect to codecov.io port 443: Connection timed out
CI=true bash <(while ! curl -sS --retry 5 --retry-delay 2 --retry-connrefused https://codecov.io/bash; do sleep 10; done) -Z -X gcov -f target/cov/lcov.info
Copy link
Contributor Author

@ryoqun ryoqun Feb 13, 2020

Choose a reason for hiding this comment

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

-Z is added... (emphasis mine):

-Z Exit with 1 if not successful. Default will Exit with 0

@ryoqun ryoqun removed the work in progress This isn't quite right yet label Feb 13, 2020
@ryoqun ryoqun requested a review from mvines February 13, 2020 13:45
@ryoqun ryoqun added the automerge Merge this Pull Request automatically once CI passes label Feb 13, 2020
@solana-grimes solana-grimes merged commit bd25705 into solana-labs:master Feb 13, 2020
@codecov
Copy link

codecov bot commented Feb 13, 2020

Codecov Report

Merging #8263 into master will increase coverage by <.1%.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           master   #8263     +/-   ##
========================================
+ Coverage    80.6%   80.6%   +<.1%     
========================================
  Files         253     253             
  Lines       55225   55225             
========================================
+ Hits        44528   44529      +1     
+ Misses      10697   10696      -1

@ryoqun
Copy link
Contributor Author

ryoqun commented Feb 13, 2020

@mvines I'm merging this as this is rather minor and want to fix early as much as possible; post merge reviews are welcome! :)

@ryoqun ryoqun added the v0.23 label Feb 13, 2020
@ryoqun ryoqun removed the request for review from mvines February 13, 2020 16:18
@ryoqun
Copy link
Contributor Author

ryoqun commented Feb 13, 2020

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Feb 13, 2020

Command refresh: success

mergify bot pushed a commit that referenced this pull request Feb 13, 2020
automerge

(cherry picked from commit bd25705)
solana-grimes pushed a commit that referenced this pull request Feb 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants