-
Notifications
You must be signed in to change notification settings - Fork 108
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
Fix delayed SSL server trace cleanup #942
Conversation
@@ -279,7 +279,9 @@ static __always_inline void finish_http(http_info_t *info, pid_connection_info_t | |||
bpf_ringbuf_submit(trace, get_flags()); | |||
} | |||
|
|||
delete_server_trace(); | |||
if (info->type == EVENT_HTTP_REQUEST) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was another bug, we were calling cleanup on the server traces even for client requests. So for Python applications (where everything happens on a single thread), if the server span made more than one client request we'd not propagate the trace id correctly on the second request.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #942 +/- ##
==========================================
+ Coverage 75.74% 79.35% +3.61%
==========================================
Files 131 131
Lines 10154 10154
==========================================
+ Hits 7691 8058 +367
+ Misses 1939 1580 -359
+ Partials 524 516 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏🏻
I found one more bug related to the cleanup of server traces for SSL black-box propagation. Since we now delay requests generation for SSL too, so that we can produce accurate response times, we were cleaning up at the time of request generation, which with HTTP keep-alive might be on the next SSL request. This new SSL request might have different *ssl pointer and we won't cleanup the correct server ID, causing context propagation to fail.
With this PR I clean-up the SSL trace info immediately as the request is captured, not waiting for the delayed generation.