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 some data races #567

Closed
wants to merge 3 commits into from
Closed

Fix some data races #567

wants to merge 3 commits into from

Conversation

knightpp
Copy link

What does this do?

I noticed data races in my codebase, turns out the issue is not in my code. So, I fixed it here.

Which issue(s) does this PR fix/relate to?

List any changes that modify/break current functionality

Tests pass

Have you included tests for your changes?

No

Did you document any new/modified functionality?

  • Updated example_test.go
  • Updated README.md

Notes

I've not tested it, only run go test ./.... Feel free to close if you feel that this PR is not appropriate.

scheduler.go Outdated Show resolved Hide resolved
@JohnRoesler
Copy link
Contributor

Thanks for the contribution!

Could you share the data races you saw? The tests are failing on this PR because of new data races that weren't previously there, so this doesn't seem to be solving the problem.

@knightpp
Copy link
Author

I cannot provide code with the issue, but the data race happens when getCurrentJob() sets an element in the map and runJobs() tries to iterate over the map.

@knightpp
Copy link
Author

Also, the fix should probably be applied to every place where jobsMap() is used in for range loop.

@JohnRoesler
Copy link
Contributor

#589 solved this issue

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