Skip to content
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
docker-archive:masterfrom
xhanio:master
Closed

Fix: deepcopy event to avoid concurrency problem#2732
xhanio wants to merge 1 commit into
docker-archive:masterfrom
xhanio:master

Conversation

@xhanio
Copy link
Copy Markdown

@xhanio xhanio commented Jun 14, 2017

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

@nishanttotla nishanttotla added this to the 1.2.8 milestone Jun 15, 2017
@nishanttotla
Copy link
Copy Markdown
Contributor

@Azure22 CI is failing. Can you take a look?

Signed-off-by: xi.han <xi.han@sihuatech.com>
@xhanio
Copy link
Copy Markdown
Author

xhanio commented Jun 15, 2017

@nishanttotla Corrected the problem. Thanks!

@nishanttotla
Copy link
Copy Markdown
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.

@nishanttotla
Copy link
Copy Markdown
Contributor

@Azure22 please let me know if your issue is now fixed in master.

@allencloud
Copy link
Copy Markdown
Contributor

I am afraid this needs a rebase, @Azure22

@xhanio
Copy link
Copy Markdown
Author

xhanio commented Jul 5, 2017

@nishanttotla @allencloud Current one is good enough for my issue. Thanks guys.

@xhanio xhanio closed this Jul 5, 2017
@nishanttotla
Copy link
Copy Markdown
Contributor

@Azure22 thanks for the update, and for your contribution 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants