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 a counter race condition #348

Merged
merged 1 commit into from Jan 31, 2023

Conversation

msm-code
Copy link
Contributor

@msm-code msm-code commented Jan 27, 2023

Your checklist for this pull request

  • I've read the contributing guideline.
  • I've tested my changes by building and running mquery, and testing changed functionality (if applicable)
  • I've added automated tests for my change (if applicable, optional)
  • I've updated documentation to reflect my change (if applicable)

What is the current behaviour?
Tasks are added first, and agent job counter is incremented second. This makes it possible for the counter to decrease below zero, cancelling the task.

What is the new behaviour?
Fixed the order and removed the race.

Test plan

Closing issues

@msm-code msm-code requested a review from nazywam January 27, 2023 16:17
@msm-code msm-code merged commit 0d9759e into CERT-Polska:master Jan 31, 2023
@msm-code msm-code deleted the fix/counter-race-condition branch January 31, 2023 18:07
@msm-code msm-code mentioned this pull request Feb 9, 2023
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.

None yet

2 participants