You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While adding HTTP client tracing in the Sentry Symfony Bundle, I noticed an issue when tracing "fire & forget" requests.
As far as I can tell, there is no reliable way to determine if the request is completed without explicitly calling $response->getContent() or $response->toArray().
In this case, the StopwatchEvent will only be stopped during TraceableResponse::__destruct
If you intend to forget the request (without actually forgetting the Response object so it is not destructed yet), there is indeed no PHP code that will run at the exact time the last network packet is received. That's a direct consequence of the design of the HttpClient API meant to support concurrency.
Note however that doing 2 requests like that in your code will make them sequential and not concurrent (as the destructor forces waiting until the status code to enforce that failed requests are handled and the destructor is called immediately in such code)
Symfony version(s) affected
v6.1.7
Description
While adding HTTP client tracing in the Sentry Symfony Bundle, I noticed an issue when tracing "fire & forget" requests.
As far as I can tell, there is no reliable way to determine if the request is completed without explicitly calling
$response->getContent()
or$response->toArray()
.In this case, the
StopwatchEvent
will only be stopped duringTraceableResponse::__destruct
How to reproduce
Possible Solution
No response
Additional Context
getsentry/sentry-symfony#606 (comment)
The text was updated successfully, but these errors were encountered: