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

fix: fix race, do not try to upload empty cpu profile #61

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

korniltsev
Copy link
Collaborator

@korniltsev korniltsev commented Oct 25, 2023

I think there is a race when the profiler is stopped. ie uploadData and uploadLastBitOfData may be running concurrently.
This pr tries to fix the race. Also makes it not try uploading empty profiles".

Although I failed to reproduce these problems. So this is just a guess.

@korniltsev
Copy link
Collaborator Author

I should add a testcase

Copy link

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

LGTM

@korniltsev
Copy link
Collaborator Author

I was able to reproduce 0 size profile and data race with these changes (manually increasing race window with time.sleep)

I dont know how to write a reliable test for it, so not going to to do it

@korniltsev korniltsev merged commit d4c3674 into main Oct 26, 2023
8 checks passed
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