File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
ddtrace/internal/datadog/profiling/dd_wrapper/src Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments