Skip to content

Commit 0adb927

Browse files
fixup! fixup! fixup! fixup! fixup! wip
1 parent 1f8efe7 commit 0adb927

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ddtrace/internal/datadog/profiling/dd_wrapper/src/ddup_interface.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,9 @@ ddup_upload() // cppcheck-suppress unusedFunction
347347
return false;
348348
}
349349

350+
// Build the Uploader, which takes care of serializing the Profile and capturing ProfilerStats.
351+
// This takes a reference in a way that locks the areas where the profile might
352+
// be modified. It gets cleared and released as soon as serialization is complete (or has failed).
350353
auto uploader_or_err = Datadog::UploaderBuilder::build();
351354

352355
if (std::holds_alternative<std::string>(uploader_or_err)) {
@@ -360,8 +363,9 @@ ddup_upload() // cppcheck-suppress unusedFunction
360363
// Get the reference to the uploader
361364
auto& uploader = std::get<Datadog::Uploader>(uploader_or_err);
362365

363-
// Upload without holding any locks
364-
// The encoding has already been done in UploaderBuilder::build
366+
// Upload without holding any locks (encoding has already been done in UploaderBuilder::build)
367+
// This also cancels inflight uploads. There are better ways to do this, but this is what
368+
// we have for now.
365369
return uploader.upload();
366370
}
367371

0 commit comments

Comments
 (0)