Commit 6c6b6ae
committed
Adjust curl timeouts, retries and logging
In #1439, the timeouts used with curl were set to higher values than
we needed for Heroku's build system, in order to prevent timeouts in
non-Heroku environments such as Dokku running on underpowered devices
(or devices with poor internet connections).
However, as seen in recent Honeycomb metrics, these higher timeouts
cause longer delays on Heroku before a curl retry if there is a
transient S3 connection issue - since the request will wait the full
10 seconds `connect_timeout` before retrying.
As such, the defaults have been lowered again to be optimised for
running on Heroku, and support for overriding the defaults via env var
added to still allow running in other environments.
Specifically:
- The default connection timeout has been lowered from 10 seconds to 3,
but can now be overridden via the env var `CURL_CONNECT_TIMEOUT`
- The default total request timeout has been lowered from 120 seconds
to 60, but can be overridden via `CURL_TIMEOUT`
These env vars cannot be set via Heroku config vars, and must instead
be set in the build system environment (or by an earlier buildpack).
The env var names match those used by the classic Ruby buildpack:
https://github.com/heroku/heroku-buildpack-ruby/blob/a6d124492aafe7f7ee0dd42d7a79284b6552d675/lib/language_pack/fetcher.rb#L47-L53
In addition, the usages of `--silent --show-error` have been replaced
with `--no-progress-meter`, which is otherwise identical apart from it
allowing warnings to be shown, such as the status messages output during
retry attempts (of form: "Will retry in 1 seconds. 3 retries left" etc).
Before:
```
-----> Installing Python 3.13.7
curl: (6) Could not resolve host: heroku-buildpack-python.s3.us-east-1.amazonaws.com
curl: (6) Could not resolve host: heroku-buildpack-python.s3.us-east-1.amazonaws.com
...
```
After:
```
-----> Installing Python 3.13.7
curl: (7) Failed to connect to heroku-buildpack-python.s3.us-east-1.amazonaws.com port 443 after 3 ms: Couldn't connect to server
Warning: Problem : connection refused. Will retry in 1 seconds. 5 retries left.
curl: (7) Failed to connect to heroku-buildpack-python.s3.us-east-1.amazonaws.com port 443 after 4 ms: Couldn't connect to server
Warning: Problem : connection refused. Will retry in 2 seconds. 4 retries left.
...
```
Lastly, the maximum number of retries has been increased slightly.
Note: The curl options used in `build_python_runtime.sh` have also been
adjusted, however, since these are only used by buildpack maintainers
(typically by running them on GitHub Actions), there is no need to those
timeouts configurable.
GUS-W-19414036.1 parent 30086f2 commit 6c6b6ae
File tree
4 files changed
+32
-26
lines changed- builds
- lib
4 files changed
+32
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
74 | | - | |
75 | | - | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | | - | |
54 | | - | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | | - | |
48 | | - | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
0 commit comments