Sarthak-Pandey opened a new pull request, #20707:
URL: https://github.com/apache/nuttx/pull/20707

   ## Summary
   
   This PR resolves intermittent network connection timeouts (`curl: (28) 
Failed to connect to github.com port 443 after 134xxx ms: Connection timed 
out`) observed during CI Docker builds on GitHub Actions (fixes #14682).
   
   ### Root Causes Addressed:
   1. **Burst Concurrency & Missing Retries:** When parallel matrix jobs run 
simultaneously, multiple concurrent HTTPS connections to external dependencies 
(`libcxx`, `NimBLE`, `LVGL`, etc.) trigger throttling or dropped packets on 
GitHub edge firewall. Without explicit retry and connect timeouts, `curl` 
stalled for >130s and aborted the build.
   2. **Matrix Fail-Fast Behavior:** Default `fail-fast: true` caused GitHub 
Actions to cancel all 12 parallel jobs whenever a single job suffered a 
transient download timeout, wasting hours of runner minutes.
   3. **PMTU / MTU Mismatches in Docker:** The default Docker bridge MTU (1500) 
can exceed cloud runner network MTUs (often 1400–1450 due to overlay 
encapsulation), resulting in PMTU blackhole drops during TLS certificate 
exchange.
   
   ### Key Changes:
   - **`tools/Config.mk`**:
     - Enhanced `DOWNLOAD` macro with `--connect-timeout $(DOWNLOAD_TIMEOUT)`, 
`--retry $(DOWNLOAD_RETRY)`, and `--retry-delay $(DOWNLOAD_DELAY)` 
(configurable with defaults: timeout 30s, retry 5, delay 5s).
     - Added a 5-attempt retry loop to the `CLONE` macro for git repositories 
(e.g., ESP/Xtensa HALs).
   - **`tools/ci/cibuild.sh` & `.github/workflows/build.yml`**:
     - Injected default `~/.curlrc` (`connect-timeout = 30`, `retry = 5`, 
`retry-delay = 5`) into container and host environments so standalone scripts 
calling `curl` directly are protected from network flakiness.
   - **`.github/workflows/build.yml`**:
     - Set `fail-fast: false` on `Linux` and `macOS` build strategies to 
prevent a single transient job failure from terminating other running jobs.
     - Added a `Configure Docker MTU` step setting Docker MTU to `1400` in 
`/etc/docker/daemon.json` to prevent PMTU blackholes.
   
   Fixes #14682
   
   ## Impact
   
   - **Build Process:** Significantly improves CI resilience against transient 
GitHub network spikes and timeout failures.
   - **CI Resource Efficiency:** Saves GitHub runner minutes by preventing 
cascading cancellations of matrix builds (`fail-fast: false`).
   - **Compatibility:** No breaking changes. Existing build commands and local 
builds remain fully compatible; timeout and retry parameters can be overridden 
via `DOWNLOAD_TIMEOUT`, `DOWNLOAD_RETRY`, and `DOWNLOAD_DELAY`.
   
   ## Testing
   
   1. Verified `curl` timeout and retry behavior:
      - Confirmed curl exits early after 30s instead of hanging for 134+ 
seconds and automatically retries with backoff upon connection timeout.
   2. Git diff and whitespace verification:
      - Passed `git diff --check` with 0 whitespace issues.
   3. YAML syntax verification:
      - Validated `.github/workflows/build.yml` structure and matrix strategy 
keys (`fail-fast: false`).
   4. Makefile macro expansion:
      - Verified `DOWNLOAD` and `CLONE` expansions in `tools/Config.mk`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to