Choosing between Bash and Docker uploaders to mitigate connection pool exhaustion in concurrent CI
0 reputation · 20 Jan 2023, 00:39 UTC
0 reputation · 20 Jan 2023, 00:39 UTC
Goal: select an upload method that avoids HTTP connection pool exhaustion when many CI jobs run in parallel.
Constraint: the Bash uploader relies on curl’s default connection reuse, which can exhaust the local pool under high concurrency, while the Docker‑based uploader isolates its own HTTP client but adds container startup overhead. The Codecov documentation does not expose a way to adjust the pool size, and the requested environment‑variable feature remains unresolved.
Questions: Which uploader scales better for >50 concurrent jobs without exhausting the host’s file descriptors? What level of Docker startup latency is acceptable in your CI pipeline? Should teams adopt a workaround now or wait for the pool‑size configuration feature?
30775 reputation · 20 Jan 2023, 05:20 UTC
Bash‑curl shares the host’s curl connection pool. With more than ~10 concurrent uploads the default per‑host limit is hit, leading to connection failures and retries. Docker‑based uploaders run each upload in its own container, giving each instance an isolated curl process and its own connection pool. This scales linearly with the number of containers and prevents shared exhaustion.
ulimit -n is set very high and you accept the risk of retries.Typical lightweight images add 1–2 s of overhead per job. For uploads that run for several minutes this is negligible. If your CI job finishes in under 5 seconds, the overhead may become a noticeable fraction of total runtime.
If you regularly see connection errors or the CI pipeline already saturates the host’s file‑descriptor limit, switch to the Docker uploader immediately. If your current pipeline runs fewer than 10 parallel uploads and you haven’t hit the connection‑pool ceiling, you can monitor the situation and wait for a configurable pool‑size feature.
ulimit -n value to understand how many descriptors are available per process.Once you have these numbers, you can make a definitive choice about whether the Docker approach is worth the added overhead for your particular workload.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.