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 duplication of ports in AllocatedResources #9368

Merged
merged 3 commits into from
Nov 16, 2020
Merged

Conversation

cgbaker
Copy link
Contributor

@cgbaker cgbaker commented Nov 15, 2020

#9367 suggests that the canonicalization of structs.Allocation.AllocatedResources is mutating the memdb object, causing the number of ports to grow on every call

there are a few solutions here:

  • rewrite canonicalize to avoid this; this allows the field to exist and attempts consistency, which is presumably what we wanted to avoid
  • mutate a copy

documenting test in the first commit:
https://app.circleci.com/pipelines/github/hashicorp/nomad/13195/workflows/63c91dd0-ea6e-440e-b080-50b68b680dbc/jobs/118749

copy-based fix in the second commit:
https://app.circleci.com/pipelines/github/hashicorp/nomad/13196/workflows/c857a136-5584-4d3f-ad10-6684bc7f9c68/jobs/118744

@cgbaker cgbaker added this to the 1.0 milestone Nov 15, 2020
Copy link
Member

@nickethier nickethier left a comment

Choose a reason for hiding this comment

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

Nice find

@cgbaker cgbaker merged commit 7a6db5f into master Nov 16, 2020
@cgbaker cgbaker deleted the b-9367-duped-ports branch November 16, 2020 17:41
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants