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: avoid race conditions from concurrent modification of data #446

Merged
merged 1 commit into from
Dec 2, 2022

Conversation

sudo-suhas
Copy link
Contributor

@sudo-suhas sudo-suhas commented Nov 30, 2022

  • Use atomic int for incrementing record count in agent run.
  • Protect fields that can be concurrently modified in a stream instance using a mutex.
  • Don't modify slice to collect runs concurrently while running multiple recipes in agent. Use channels to collect runs instead.
  • Avoid referring to and modification of errors or values declared outside closures.

@sudo-suhas sudo-suhas force-pushed the avoid-race-conditions branch 2 times, most recently from d1dcd9d to c7d9fda Compare November 30, 2022 12:03
@sudo-suhas sudo-suhas force-pushed the avoid-race-conditions branch 2 times, most recently from aceb48b to 3678417 Compare December 2, 2022 06:48
- Use atomic int for incrementing record count in agent run.
- Protect fields that can be concurrently modified in a stream instance
  using a mutex.
- Avoid referring to and modification of errors or values declared
  outside closures.
@sudo-suhas sudo-suhas merged commit 7fd6168 into main Dec 2, 2022
@sudo-suhas sudo-suhas deleted the avoid-race-conditions branch December 2, 2022 08:43
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