Welcome! Please see the About page for a little more info on how this works.

0 votes
ago in Tools by

Hi!

I'm the maintainer for Heroku's Clojure buildpack. It uses the install scripts from clojure/brew-install to install the CLI. I noticed intermittent install failures related to the download of the Clojure tools. I believe most of them could be avoided with a slightly changed curl command line options.

I opened a PR before realizing that PRs will not be accepted, so I'm starting this thread to properly get the discussion going. For reference, the closed PR can be found here: https://github.com/clojure/brew-install/pull/10

I believe these options would improve the download behaviour for all users, but especially when used in automations:

--connect-timeout 3 (https://curl.se/docs/manpage.html#--connect-timeout)
Prevents hanging when server is unreachable.

--fail (https://curl.se/docs/manpage.html#-f)
Exit with error code 22 for HTTP responses with status codes >= 400.

--max-time 60 (https://curl.se/docs/manpage.html#-m)
Maximum time in seconds for the entire transfer operation. Prevents hanging indefinitely with slow connections.

--no-progress-meter (https://curl.se/docs/manpage.html#--no-progress-meter)
Introduced in curl 7.67.0 (Nov 2019). Disables the progress bar for cleaner output. But less drastic than --silent and will still output diagnostic information (i.e. retries).

--retry-max-time 60 (https://curl.se/docs/manpage.html#--retry-max-time)
Retry only within this time period (60 seconds). After this time expires, no more retries will be attempted.

--retry 5 (https://curl.se/docs/manpage.html#--retry)
Introduced in curl 7.12.3 (Dec 2004). Retry up to 5 times on transient errors (timeouts, HTTP 408, 429, 500, 502, 503, 504, 522, 524).

--retry-connrefused (https://curl.se/docs/manpage.html#--retry-connrefused)
Introduced in curl 7.52.0 (Dec 2016). Consider connection refused as a transient error for --retry.

These are obviously opinionated and my ask is not for these options specifically. Happy to get anything that will improve the situation. :)

Manuel

Please log in or register to answer this question.

...