Skip to content

Ensure the uploader task is started once all required interface fields are set#155

Closed
gregomite wants to merge 1 commit into
DataDog:developfrom
gregomite:fix/152
Closed

Ensure the uploader task is started once all required interface fields are set#155
gregomite wants to merge 1 commit into
DataDog:developfrom
gregomite:fix/152

Conversation

@gregomite

Copy link
Copy Markdown
Contributor

What does this PR do?

This is a code suggestion that serves as a possible fix for issue #154.

Motivation

The race condition described in #154 can result from the code pattern used in the Datadog SDK for starting tasks from the init() function. This pattern may lead to race conditions. I'd like to propose a new way as a remedy. The idea is to set all the task's interface fields before the task runs. This PR outlines the best practice for doing this.

Additional Notes

This is simply a proof. This change breaks the unit tests written for MultiTrackUploaderTask. I can circle back and debug that. But I wanted to communicate this code change in a timely manner.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@ambushwork

Copy link
Copy Markdown
Member

@gregomite thanks for contributing the fix, due to Datadog security policy the external PR can not trigger the pipeline, I have opened another PR with your fix, also added a unit test to cover the issue.

@gregomite

Copy link
Copy Markdown
Contributor Author

Closing in favor of #156. Thank you @ambushwork! Very much appreciated!

@gregomite gregomite closed this May 15, 2026
@gregomite
gregomite deleted the fix/152 branch May 15, 2026 16:53
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