endpoint_cnt store updates should not create an object#2004
Merged
mavenugo merged 1 commit intomoby:masterfrom Nov 6, 2017
Merged
endpoint_cnt store updates should not create an object#2004mavenugo merged 1 commit intomoby:masterfrom
mavenugo merged 1 commit intomoby:masterfrom
Conversation
endpoint_cnt object is created during network create and destroyed when network is deleted. But the updateToStore function creates an object when it is not present in the store. endpoint_cnt is a mutable object and is updated during endpoint create and delete events. If endpoint create or delete happens after the network is deleted, it can incorrectly create an endpoint_cnt object in the store and that can cause problems when the same network is created again later. The fix is to not create the endpoint_cnt object when endpoint_cnt is incremented or decremented Signed-off-by: Madhu Venugopal <madhu@docker.com>
Contributor
Author
|
ping @fcrisciani @abhi |
Contributor
|
LGTM. Fix has been verified locally. |
Codecov Report
@@ Coverage Diff @@
## master #2004 +/- ##
=========================================
Coverage ? 38.05%
=========================================
Files ? 137
Lines ? 27367
Branches ? 0
=========================================
Hits ? 10415
Misses ? 15680
Partials ? 1272
Continue to review full report at Codecov.
|
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.
endpoint_cnt object is created during network create and destroyed when
network is deleted. But the updateToStore function creates an object
when it is not present in the store. endpoint_cnt is a mutable object
and is updated during endpoint create and delete events. If endpoint
create or delete happens after the network is deleted, it can
incorrectly create an endpoint_cnt object in the store and that can
cause problems when the same network is created again later.
The fix is to not create the endpoint_cnt object when endpoint_cnt is
incremented or decremented
This handles the error seen in moby/moby#35310.
But I think moby/moby#35310 needs a more complete fix which is not handled in this PR
Signed-off-by: Madhu Venugopal madhu@docker.com