-
Notifications
You must be signed in to change notification settings - Fork 2k
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
client: prevent watching stale alloc state #18612
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
However, note the semgrep error on time.After
. The NewSafeTimer
helper provides a safer abstraction that provides compiler support in avoiding leaking the goroutine.
When waiting on a previous alloc we must query against the leader before switching to a stale query with index set. Also check to ensure the response is fresh before using it like #18269
9463896
to
c7bab36
Compare
case <-time.After(retry): | ||
case <-timer.C: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry this is an unrelated fix from a linting error I introduced in my previous PR: #18601
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
When waiting on a previous alloc we must query against the leader before switching to a stale query with index set. Also check to ensure the response is fresh before using it like #18269
When waiting on a previous alloc we must query against the leader before switching to a stale query with index set. Also check to ensure the response is fresh before using it like #18269
When waiting on a previous alloc we must query against the leader before switching to a stale query with index set. Also check to ensure the response is fresh before using it like #18269
Backports failed: https://github.com/hashicorp/nomad/actions/runs/6356400700 Manual 1.4.x backport: e531bf1 Manual 1.5.x backport: 376a350 Manual 1.6.x backport: b6f62d5 |
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. |
When waiting on a previous alloc we must query against the leader before switching to a stale query with index set.
Also check to ensure the response is fresh before using it like #18269