mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
It appears that ResponseHeaderTimeout needs to be set explicitly, no headers response from the server doesn't seem to be covered by any other timeout. This should fix the download getting stuck issue. For more context, see the stacktrace obtained from a system where download got stuck: https://pastebin.canonical.com/p/nZkRMTBbv3/ (the affected goroutine seems to be sitting inside for-select loop of /usr/lib/go-1.10/src/net/http/transport.go:2033) (to play with it comment out ResponseHeaderTimeout: ... from transport.go and modify test timeout from 5 * time.Second to a huge value and it should be stuck) * Set ResponseHeaderTimeout on the default transport. * Use 250ms for mocked ResponseHeaderTimeout. * Bump ResponseHeaderTimeout to 15s. * Bump test timeout to avoid potential issues with LP builds.