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

Client only pulls update allocations from server #731

Merged
merged 5 commits into from
Feb 2, 2016

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Feb 1, 2016

Previously the client would pull all its allocations whenever the modify index of an allocation that should be running on it changed.

This PR modifies the client to track how many updates have occurred locally to the running alloc and then only pulls a lightweight list of allocation ids to modify indexes from the server. It uses this to decide whether an updated version of the allocation needs to be pulled from the server.

This reduces network traffic when the client updates allocs to the server.

@dadgar dadgar force-pushed the f-reduce-client-alloc-pulls branch from 4fb09c4 to 4322509 Compare February 1, 2016 21:58
@dadgar dadgar force-pushed the f-reduce-client-alloc-pulls branch from f13c04d to 3b90539 Compare February 1, 2016 23:44
@@ -184,6 +187,8 @@ func (r *AllocRunner) DestroyContext() error {

// Alloc returns the associated allocation
func (r *AllocRunner) Alloc() *structs.Allocation {
r.allocLock.Lock()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to acquire a lock here? I don't see us mutating anything here. Does the caller expects the alloc to not change once it has? We should probably make a copy and return if that's the assumption, otherwise the alloc might change under the hood once the caller has it.

dadgar added a commit that referenced this pull request Feb 2, 2016
Client only pulls update allocations from server
@dadgar dadgar merged commit 04f48c5 into master Feb 2, 2016
@dadgar dadgar deleted the f-reduce-client-alloc-pulls branch February 2, 2016 21:26
@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 Apr 29, 2023
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.

2 participants