Skip to content

[HttpClient] Fix collecting data non-late for the profiler #49104

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
Jan 25, 2023

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #49096
License MIT
Doc PR -

@silverbackdan @pforesi could you please confirm that this fixes both your use cases?

@carsonbot carsonbot added this to the 5.4 milestone Jan 25, 2023
@nicolas-grekas nicolas-grekas changed the title Update CHANGELOG for 5.4.19 [HttpClient] Fix collecting data non-late for the profiler Jan 25, 2023
@silverbackdan
Copy link

Really sorry but I do have gaps in my knowledge on how I bring in this change into my application to test the fix. I'm using the latest Symfony version, would you be find enough to let me know how to bring the change into my application and I'll run my tests again.

@nicolas-grekas
Copy link
Member Author

The easiest way might be to just replace the file in your vendor directory by copy/pasting the one attached to this PR.

@silverbackdan
Copy link

Thanks @nicolas-grekas but I'm afraid the problem still persists

@silverbackdan
Copy link

I've done some dumping in the function and I think the issue is that with either of the new updates, the function is called twice. I can confirm that reverting just this file back to the previous version causes no issues so it is related to this change.

@silverbackdan
Copy link

doCollect is called twice with reset as true
It looks like it's being triggered from an event listener.

@silverbackdan
Copy link

Sorry for many messages and deleted ones. In the profiler listener onKernelTerminate there are 2 profiles on my test requests. This causes saveProfile to be called twice which seems to filter down and then make doCollect to be called twice too.

In my case I seem to have requests for these.

_api_/dummy_components/{id}{._format}_delete
_api_/page_data_with_components/{id}{._format}_get

So perhaps in my code somewhere I am performing a sub-request which means that the trace would be cleared?

@nicolas-grekas
Copy link
Member Author

No worries :)
Can you try the updated patch please?

@silverbackdan
Copy link

Looks like it works :)

@silverbackdan
Copy link

Will this be in 6.2.6? I'll leave a conflict in my composer for 6.2.5 just so I don't get failing tests :)

@nicolas-grekas nicolas-grekas deleted the hc-collect branch January 25, 2023 18:36
@nicolas-grekas
Copy link
Member Author

Of course :)

@silverbackdan
Copy link

Thanks as always @nicolas-grekas

@amalricBzh
Copy link

Hello,
On a SF 5.4 micro-service application, with:

  • http-client 5.4.19
  • web-profiler-bundle : 5.4.19
    => Everything is ok, The profiler collect HTTP calls data.

But with http-client 5.4.20 wich include this PR => It's KO, the web profiler doesn't collect any HTTP Client calls, the "Http Client" tab is empty 😢 .

@fancyweb
Copy link
Contributor

Hello, it has been fixed in #49301. The patch should be released at the end of the month.

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.

6 participants