Skip to content
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

Capture manager should check shutdown before attempting to record captures #870

Merged
merged 4 commits into from
Apr 10, 2024

Conversation

scottopell
Copy link
Contributor

What does this PR do?

Addresses a shutdown race that can occur where record_captures is called incorrectly after the experiment has shut down.
This can result in truncated capture.json result files.

Motivation

Fixing a bug in capture writing.

Related issues

Additional Notes

@scottopell scottopell requested a review from a team as a code owner April 2, 2024 14:03
Comment on lines 196 to 200
if self.shutdown.try_recv() {
info!("shutdown signal received");
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to wait in the main thread until this is hit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scottopell mind linking that ticket here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://datadoghq.atlassian.net/browse/SMPTNG-340 is the future, more proper fix. I'll add this into the code as a comment

@scottopell scottopell enabled auto-merge (squash) April 3, 2024 20:42
@scottopell scottopell force-pushed the sopell/captures-check-shutdown-firstthing branch from 57fc6c5 to 1bb7d3c Compare April 10, 2024 15:07
@scottopell scottopell merged commit 355004e into main Apr 10, 2024
12 checks passed
@scottopell scottopell deleted the sopell/captures-check-shutdown-firstthing branch April 10, 2024 15: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