bug #39115 [HttpClient] don't fallback to HTTP/1.1 when HTTP/2 streams break (nicolas...
authorFabien Potencier <fabien@potencier.org>
Thu, 19 Nov 2020 06:02:19 +0000 (07:02 +0100)
committerFabien Potencier <fabien@potencier.org>
Thu, 19 Nov 2020 06:02:19 +0000 (07:02 +0100)
commitb60bb6e2d6051f150ea06dd794ae2894e79aacd8
tree90de5658c621eb98d44c1912187dc5f19d2192c8
parent308231aafbd419acd0014e71e4c7ee652a6a529c
parent0c92bc5a8324d5c0a0e247b5f4b8fa90551362b5
bug #39115 [HttpClient] don't fallback to HTTP/1.1 when HTTP/2 streams break (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] don't fallback to HTTP/1.1 when HTTP/2 streams break

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/composer/composer/issues/9481
| License       | MIT
| Doc PR        | -

With this change, I don't reproduce the failures that I describe in https://github.com/composer/composer/issues/9481 when running the script in #38690

Apparently curl has an issue when both h1.1 and h2 connections are open to the same host.

Instead of switching to HTTP/1.1 when retrying requests that failed because of an HTTP/2 stream error, I propose to close the http/2 connection when issuing a retry.

With this change, running the mirroring script of packagist works like a charm.

No need to investigate your mirrors @Seldaek, this was definitely a data corruption issue.

Commits
-------

0c92bc5a83 [HttpClient] don't fallback to HTTP/1.1 when HTTP/2 streams break