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

Allocated Ports are duplicated on Alloc info #9367

Closed
cgbaker opened this issue Nov 15, 2020 · 5 comments
Closed

Allocated Ports are duplicated on Alloc info #9367

cgbaker opened this issue Nov 15, 2020 · 5 comments
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. type/bug
Milestone

Comments

@cgbaker
Copy link
Contributor

cgbaker commented Nov 15, 2020

Nomad version

Nomad v1.0.0-beta3 (fcb32ef)

Issue

the ports listed under AllocatedResources contain a growing list of duplicated allocations

Reproduction steps

  1. create a job with a static port resource (I used the traefik job)
  2. note that on every query to the allocation, the AllocatedResources includes an increasing number of copies of the port reservations:
$ nomad alloc status -json 44302903  | jq '.AllocatedResources.Shared.Ports | length'
56

$ nomad alloc status -json 44302903  | jq '.AllocatedResources.Shared.Ports | length'
58

I suspect that the issue is that the allocGet endpoint is calling canonicalize on the in-mem structs object:

alloc.AllocatedResources.Canonicalize()

@cgbaker cgbaker added stage/accepted Confirmed, and intend to work on. No timeline committment though. type/bug labels Nov 15, 2020
@cgbaker cgbaker added this to the 1.0 milestone Nov 15, 2020
cgbaker added a commit that referenced this issue Nov 15, 2020
@cgbaker
Copy link
Contributor Author

cgbaker commented Nov 18, 2020

still an issue on 0.12.8
also, PR #9368 potentially does a double-copy (I missed that there is a potential alloc copy in there if the job payload is decoded)

@tgross
Copy link
Member

tgross commented Nov 30, 2020

@cgbaker should this have been closed by #9367 or is this something we need to get fixed before 1.0-rc?

@tgross
Copy link
Member

tgross commented Nov 30, 2020

Checked with current master:

$ nomad job run ./traefik.nomad
Job Warnings:
1 warning(s):

* Group "traefik" has warnings: 1 error occurred:
        * 1 error occurred:
        * Task "traefik": task network resources have been deprecated as of Nomad 0.12.0. Please configure networking via group network block.





==> Monitoring evaluation "75abe09a"
    Evaluation triggered by job "traefik"
    Allocation "a223dff5" created: node "ae49493f", group "traefik"
==> Monitoring evaluation "75abe09a"
    Evaluation within deployment: "5371c3e0"
    Evaluation status changed: "pending" -> "complete"
==> Evaluation "75abe09a" finished with status "complete"

$ nomad alloc status -json a223dff5 | jq '.AllocatedResources.Shared.Ports | length'
2
$ nomad alloc status -json a223dff5 | jq '.AllocatedResources.Shared.Ports | length'
2

Looks like we're good?

@tgross
Copy link
Member

tgross commented Dec 4, 2020

Verified with RC1.

@tgross tgross closed this as completed Dec 4, 2020
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. type/bug
Projects
None yet
Development

No branches or pull requests

2 participants