-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpClient] CURLMOPT_PUSHFUNCTION breaks on CLI #57681
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
Comments
The error tells about CURLMOPT_PROGRESSFUNCTION, what's the link with CURLMOPT_PUSHFUNCTION? Can you please provide a full reproducer, with an actual endpoint that highlights this behavior? |
I created a small demo app: https://github.com/aleho/httpclient-reproducer Partly useless code because the issue is weird (e.g. fewer calls to the logger will not trigger any problems). After debugging and trying to reliably reproduce this problem for hours (actually days) now I'm honestly at my wit's end. It's really hard to reproduce consistently outside of our somewhat larger project. In the larger project as soon as At the moment I only have one URL that is a public website out of my control ( As soon as pushed response handling is disabled the error goes away, so that's why I thought it was related somehow. Also, if I disable the 'on_progress' function in TraceableHttpClient no warnings occur locally (because there's no callback at all). Anyways, I'm really not sure how to reproduce it reliably. Just now I got another segfault locally in prod mode but the next run didn't crash at all. On our server the message queue crashed reliably every time it tried to handle the URL, locally only sometimes. Everything in the same container. One of the cases I can reproduce it locally in the app linked above:
A call immediately after the previous one:
It also seems to be related to code changes or recompilation (locally). If I comment an unused portion of the code and execute the command I can reliably either produce the PHP warning or sometimes a segfault. Both with JIT and OPCache (+CLI) disabled or enabled. |
Thanks for all the details. Let's disable PUSH by default, see #57870 |
…l (nicolas-grekas) This PR was merged into the 5.4 branch. Discussion ---------- [HttpClient] Disable HTTP/2 PUSH by default when using curl | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #57681 | License | MIT I propose to disable HTTP/2 PUSH by default when using curl. Amp still supports it out of the box, but support in curl is too fragile (it segfaults, see linked issue). We have to balance: - seeing a perf downgrade for apps that might benefit from pushes - vs putting every users at risk with a possible segfault when a server sends PUSH frames Preventing this possible segfault is the most important here IMHO. Apps that leverage PUSH should be rare, and can re-enable if they really want to. Commits ------- ae9b889 [HttpClient] Disable HTTP/2 PUSH by default when using curl
Symfony version(s) affected
6.4
Description
This weekend I was seeing quite a few crashes in an app processing URLs in messenger.
Trying to reproduce the bug locally I started to see warnings on the console I've never encountered before. Apparently there was a change in an upstream service where they now push content in the
Link:
header since Friday.How to reproduce
HttpClientInterface
into a command.Link:
header.Possible Solution
As I don't need the resources at all (I'm only requesting the URL because I want to determine the content type, and sometimes the app gets an URL to HTML instead of e.g. images) my first idea was setting
$maxPendingPushes
to 0 which seems to be passed-through all the way fromHttpClient
toCurlClientState
.I couldn't find any documented option for that parameter (like, e.g.
max_pending_pushes
) so the only way I could come up with was to use a compiler pass.Additional Context
No response
The text was updated successfully, but these errors were encountered: