Skip to content

network timeout configuration doesn't always work #8516

Closed
@ehuss

Description

@ehuss

Problem
Cargo seems to mostly ignore the http.timeout configuration.

The problem is that progress function that handles timeouts is not called when there is no network traffic. According to https://curl.haxx.se/libcurl/c/CURLOPT_PROGRESSFUNCTION.html, when using the multi interface the progress won't get called during idleness "unless you call the appropriate libcurl function that performs transfers" whatever that means.

Steps

  1. Start a network transfer (cargo fetch).
  2. Pull the network cord.
  3. Wait. Cargo's timeout will not match the value in http.timeout. Typically it seems to time out after 2.5 minutes on Linux and macOS. Windows was a little more confusing (I couldn't really get a good reading).

Possible Solution(s)
Uncertain if there is some way to force libcurl to call the progress function with the multi interface?

Notes

cargo 1.46.0-nightly (4f74d9b2a 2020-07-08)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-networkingArea: networking issues, curl, etc.C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions