Skip to content

fix(curl): enforce drain to clear in-flight requests#215

Merged
dmehala merged 1 commit intomainfrom
dmehala/telemetry/fix-app-started
May 17, 2025
Merged

fix(curl): enforce drain to clear in-flight requests#215
dmehala merged 1 commit intomainfrom
dmehala/telemetry/fix-app-started

Conversation

@dmehala
Copy link
Copy Markdown
Collaborator

@dmehala dmehala commented May 14, 2025

Description

Fix the issue reported in #213.

What's going on?

Root Cause

make_telemetry initializes a Telemetry object, which is then "moved" via the move constructor. During construction, the Telemetry constructor makes an asynchronous HTTP request for the app-started event.
If this request is not processed before the move occurs, the lambda callback associated with the request reference the original (now-invalid) object. This results in a dangling pointer access and leads to a crash 💥.

Fix

The fix enhance the drain mechanism by canceling/removing requests in-flight. This ensures that any in-flight requests are resolved or cleared before the object is moved or destroyed, avoiding use-after-move scenarios.

@dmehala dmehala requested a review from a team as a code owner May 14, 2025 15:00
@dmehala dmehala requested review from a team, dubloom and pablomartinezbernardo and removed request for a team May 14, 2025 15:00
@dmehala dmehala changed the title fix(curl): enforce drain to clear requests in-flight. fix(curl): enforce drain to clear in-flight requests May 14, 2025
@dmehala dmehala merged commit 290cc27 into main May 17, 2025
22 checks passed
@dmehala dmehala deleted the dmehala/telemetry/fix-app-started branch May 17, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants