Skip to content

[HttpClient] unset activity list when creating CurlResponse #37400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Jun 23, 2020

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

This might fix an error that looks like a race condition.
I've seen it, and @Toflar too, but we're unable to reproduce.

Argument 2 passed to Symfony\Component\HttpClient\Chunk\DataChunk::__construct() must be of the type string, null given

This patch tentatively empties activity lists. If the issue is related to the PHP engine reusing resource ids, this will fix it. Otherwise, we'll know we'll have to look elsewhere.

looking at https://github.com/symfony/http-client/blob/4.4/Response/ResponseTrait.php#L363 I don’t really see how this can happen other than inflate_add() returning null

$response->inflate is true before becoming a resource; there must be a race condition in the curl client that ends up listing a data chunk before a FirstChunk in the activity list, which would explain why inflate_add is given a non-resource (true).

@fabpot
Copy link
Member

fabpot commented Jun 24, 2020

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 98acf1c into symfony:4.4 Jun 24, 2020
@nicolas-grekas nicolas-grekas deleted the hc-empty-activity branch June 28, 2020 10:47
This was referenced Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants