This repository was archived by the owner on Feb 1, 2021. It is now read-only.
Fix: deepcopy event to avoid concurrency problem#2732
Closed
xhanio wants to merge 1 commit into
Closed
Conversation
Contributor
|
@Azure22 CI is failing. Can you take a look? |
Signed-off-by: xi.han <xi.han@sihuatech.com>
Author
|
@nishanttotla Corrected the problem. Thanks! |
Contributor
|
@Azure22 thanks for the work on this. I agree that there is a race condition here that must be fixed. In #2747, we are restructuring the way events are handled, and I think the race condition will be fixed as part of that PR, which is urgently slated for the next release. If it fixes your panic, great. If not, we'll work to get this PR in as well. |
Contributor
|
@Azure22 please let me know if your issue is now fixed in master. |
Contributor
|
I am afraid this needs a rebase, @Azure22 |
Author
|
@nishanttotla @allencloud Current one is good enough for my issue. Thanks guys. |
Contributor
|
@Azure22 thanks for the update, and for your contribution 😄 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
We currently encountered a panic reading from event.Actor.Attributes. The reason is because when swarm API handles the event it writes on it at the same time. To avoid this panic due to concurrent reading and writing on the map, a deep copy of the event is necessary.
Signed-off-by: xi.han xi.han@sihuatech.com