hashicorp / hashicorp/nomad

invalid invariants documented in `NetworkIndex.SetNode`

Open
#17,868 0 comments 0 reactions 0 assignees View on GitHub
stage/needs-investigation theme/networking theme/tech-debt
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

While working on https://github.com/hashicorp/nomad/pull/16401 a while back I noticed that [`NetworkIndex.SetNode`](https://github.com/hashicorp/nomad/blob/v1.5.6/nomad/structs/network.go#L211) documents some invariants that don't seem to be true but maybe aren't necessary either. This says they need to be idempotent but they're never actually called twice on the same instance as far as I can tell.

This needs some investigation and probable refactoring when we go thru and finally clean up the old network resource structs.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in nomad/structs/network.go at NetworkIndex.SetNode, then inspect its call sites to determine whether the documented idempotency invariant is exercised. Confirm whether the invariant is necessary and identify the old network resource structs involved. Done means the documentation and any required refactoring accurately reflect the observed usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.