Skip to content

Comments

fix Issue 16349 - better curl retry for install.sh script#187

Merged
MartinNowak merged 1 commit intodlang:masterfrom
MartinNowak:fix16349
Aug 6, 2016
Merged

fix Issue 16349 - better curl retry for install.sh script#187
MartinNowak merged 1 commit intodlang:masterfrom
MartinNowak:fix16349

Conversation

@MartinNowak
Copy link
Member

  • curl's --retry option isn't really helpful b/c no timeouts are
    activated by default
  • use a retry loop with increasing sleep times instead
  • enable connection (5s) and download (<1KB/s for 30s) timeouts
    (using --max-time is too tricky b/c of the unknown download sizes)

- curl's --retry option isn't really helpful b/c no timeouts are
  activated by default
- use a retry loop with increasing sleep times instead
- enable connection (5s) and download (<1KB/s for 30s) timeouts
  (using --max-time is too tricky b/c of the unknown download sizes)
@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
16349 better curl retry for install.sh script

@MartinNowak
Copy link
Member Author

FYI @wilzbach

elif [ $i -lt 4 ]; then
sleep $((1 << $i))
else
fatal "Failed to download '$url'"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we try to cleanup intermediate temp files on failure?
(due to fatal exiting directly the cleanup in fetch won't take place)

Copy link
Member Author

@MartinNowak MartinNowak Aug 6, 2016

Choose a reason for hiding this comment

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

There is already a cleanup trap that wipes the whole TMP_ROOT, I'm just deleting intermediate temporaries for cleanliness.

@MartinNowak
Copy link
Member Author

I tested all compilers, and the --activate functionality. Also played a bit w/ tc to simulate a bad network connection, but it's tricky to properly test this. It should be better than before.

@wilzbach
Copy link
Contributor

wilzbach commented Aug 6, 2016

I tested all compilers

Maybe at some point we should setup a small travis CI for this repo that does this automatically? ;-)

Also played a bit w/ tc to simulate a bad network connection, but it's tricky to properly test this. It should be better than before.

I did the same and also tried it a bit and it looks really good - e.g. I interrupted the network during the download and all the retry and timeouts fire correctly :)

Downloading and unpacking http://downloads.dlang.org/releases/2.x/2.071.1/dmd.2.071.1.linux.tar.xz
##                                                                         3.4%



curl: (28) Operation too slow. Less than 1024 bytes/sec transferred the last 30 seconds

curl: (7) Couldn't connect to server

curl: (7) Couldn't connect to server

curl: (7) Couldn't connect to server

curl: (7) Couldn't connect to server
Failed to download 'http://downloads.dlang.org/releases/2.x/2.071.1/dmd.2.071.1.linux.tar.xz'

So from my side this looks great - thanks for doing this @MartinNowak :)

@MartinNowak MartinNowak merged commit c777a91 into dlang:master Aug 6, 2016
@MartinNowak MartinNowak deleted the fix16349 branch August 6, 2016 15:43
@MartinNowak
Copy link
Member Author

Let's closely monitor if that fixes the remaining Travis-CI issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants