sdkserver: fix race condition in SDK.SetLabel and SDK.SetAnnotation (issue #455)#588
Merged
jkowalski merged 1 commit intoagones-dev:masterfrom Feb 13, 2019
Merged
Conversation
Collaborator
|
Build Failed 😱 Build Id: 1c400861-b848-408c-a4ac-83cbc15548a2 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
d0f8147 to
96a26dc
Compare
Collaborator
|
Build Succeeded 👏 Build Id: 3f5630d9-5784-4aa2-9cdb-4daddf8112cb The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
jkowalski
reviewed
Feb 13, 2019
| streamMutex: sync.RWMutex{}, | ||
| gsLabels: map[string]string{}, | ||
| gsAnnotations: map[string]string{}, | ||
| gsUpdateMutex: sync.RWMutex{}, |
Contributor
There was a problem hiding this comment.
nit: no need to initialize mutex like that (default value is fine). feel free to remove all of those.
jkowalski
approved these changes
Feb 13, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix issue #455.
When synchronizing GameServer with requested operations, i.e. updateState, updateLabel, updateAnnotation, change the key format from {operation}/{data} to {operation}. The operation data is persisted in SDKServer to prevent old operation data from overwriting the new one.