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 possible port collisions across tasks #2215

Merged
merged 3 commits into from
Jul 1, 2021
Merged

Fix possible port collisions across tasks #2215

merged 3 commits into from
Jul 1, 2021

Conversation

ssalinas
Copy link
Member

There was a subtle race condition here since we thread out across TaskHolder objects, not across OfferHolder objects when constructing tasks to submit to the master. This makes it possible that two buildTask calls are running at once, before either of them calls addMatchedTask on the offer holder. The former of those grabs ports to assign to a task, while the latter subtracts the assigned ports from the offer resources so they aren't used a second time. Obviously not safe to run in parallel :doh:. Moved that all into the acceptTask method and marked as synchronized

@ssalinas ssalinas added the staging Merged to staging branch label Jun 30, 2021
@rosalind210
Copy link
Contributor

🚢

@ssalinas ssalinas merged commit fc1aaf2 into master Jul 1, 2021
@ssalinas ssalinas deleted the port_collision branch July 1, 2021 13:35
@ssalinas ssalinas added this to the 1.5.0 milestone May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staging Merged to staging branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants