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

Ensure that the index processed by the client is at least as new as the last one processed. #18269

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/18269.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
client: Ignore stale server updates to prevent GCing allocations that should be running
```
12 changes: 12 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2360,6 +2360,18 @@ OUTER:
default:
}

// We have not received any new data, or received stale data. This may happen in
// an array of situations, the worst of which seems to be a blocking request
// timeout when the scheduler which we are contacting is newly added or recovering
// after a prolonged downtime.
//
// For full context, please see https://github.com/hashicorp/nomad/issues/18267
if resp.Index <= req.MinQueryIndex {
c.logger.Debug("Received stale allocation information. Retrying.",
"index", resp.Index, "min_index", req.MinQueryIndex)
continue OUTER
}

// Filter all allocations whose AllocModifyIndex was not incremented.
// These are the allocations who have either not been updated, or whose
// updates are a result of the client sending an update for the alloc.
Expand Down
Loading