Skip to content

Download timeout is now intended as inactivity-timeout#3076

Merged
cmaglie merged 10 commits into
arduino:masterfrom
cmaglie:download-timeout
Jan 13, 2026
Merged

Download timeout is now intended as inactivity-timeout#3076
cmaglie merged 10 commits into
arduino:masterfrom
cmaglie:download-timeout

Conversation

@cmaglie

@cmaglie cmaglie commented Jan 12, 2026

Copy link
Copy Markdown
Member

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

This PR tries to solve issues with download timeouts.

What is the current behavior?

The default setting for network.connection_timeout is 60 seconds. Previously, this timeout was considered a global deadline, meaning that a download started at time T would be terminated if it didn't complete before T+60.
While this setup would work for most users, we've seen an increase in issues from users who report that the download is abruptly terminated without any apparent reason, simply because it ran longer than expected and exceeded the 60-second timeout.

What is the new behavior?

This PR changes the meaning of the network.connection_timeout. It is now intended as an inactivity timeout. This means that the download is terminated if the time elapsed since the last byte received exceeds the connection timeout.
This change should account for a slow connection without sacrificing the original intent of the timeout.

Does this PR introduce a breaking change, and is titled accordingly?

No

Other information

Fix #3013

@cmaglie cmaglie self-assigned this Jan 12, 2026
@cmaglie cmaglie added type: enhancement Proposed improvement priority: high Resolution is a high priority topic: code Related to content of the project itself labels Jan 12, 2026
@codecov

codecov Bot commented Jan 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.48148% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.52%. Comparing base (4977282) to head (7d9dd7b).
⚠️ Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
internal/arduino/resources/checksums.go 0.00% 2 Missing ⚠️
internal/arduino/resources/index.go 50.00% 2 Missing ⚠️
internal/cli/configuration/network.go 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3076      +/-   ##
==========================================
+ Coverage   69.49%   69.52%   +0.03%     
==========================================
  Files         253      253              
  Lines       19172    19173       +1     
==========================================
+ Hits        13323    13330       +7     
+ Misses       4617     4614       -3     
+ Partials     1232     1229       -3     
Flag Coverage Δ
unit 69.52% <81.48%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
This will help to make the next commits cleaner
go-downloader is able to add extra headers, there is no need to use the
the round-tripper trick. Anyway, we still have API calls going in the
Arduino CLI, so we need to keep NewHttpClient for such usages.
Better specify that the timeout now is an "inactivity" timeout rather than
a "connection" timeout.
Comment thread internal/arduino/resources/index.go
Comment thread internal/arduino/resources/index.go
@cmaglie cmaglie merged commit 33cb387 into arduino:master Jan 13, 2026
177 of 178 checks passed
@cmaglie cmaglie deleted the download-timeout branch January 13, 2026 16:44
@krypt-lx

Copy link
Copy Markdown

I see this PR calls this timeout "Inactivity Timeout", but it actually the behavior of proper "Connection Timeout": No data received for given period, a single byte resets the timer.

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: package-management Related to the packaging and managing of the platform/libraries and removed type: enhancement Proposed improvement labels Feb 25, 2026
thiagoralves pushed a commit to Autonomy-Logic/openplc-editor that referenced this pull request Apr 4, 2026
…d timeout

Arduino CLI 1.3.1 enforces a 60-second hard deadline on HTTP downloads.
The ESP32 board support package (~311 MiB) cannot finish downloading
within that window on most connections, causing "context deadline
exceeded (Client.Timeout)" errors during `core install`.

v1.4.1 (PR arduino/arduino-cli#3076) changes the timeout semantics from
a total request deadline to an inactivity timeout — downloads only fail
if no data arrives for 60 seconds, allowing large packages to complete.

Fixes platform installation timeout regression reported in v4.1.4.

https://claude.ai/code/session_01DdRdfrSzLi4Sgh8e4HhkVM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: high Resolution is a high priority topic: code Related to content of the project itself topic: package-management Related to the packaging and managing of the platform/libraries type: imperfection Perceived defect in any part of project

4 participants