Fix some more race conditions #6214

Merged
merged 3 commits into from Jun 12, 2014

Conversation

Projects
None yet
4 participants
@LK4D4
Contributor

LK4D4 commented Jun 5, 2014

Another -race load testing.
I'm not very sure about changes to server/buildfile.go, but it seems working good.
ping @vieux @unclejack @crosbymichael

@crosbymichael

View changes

daemon/container.go
@@ -464,6 +462,8 @@ func (container *Container) monitor(callback execdriver.StartCallback) error {
}
}
+ close(container.waitLock)

This comment has been minimized.

@crosbymichael

crosbymichael Jun 5, 2014

Contributor

You cannot move this, we moved this before changing the state because there is a race between the two that causes a panic.

The real fix for this is that we don't have the same information in two places ( wait lock and State ), until then there will always be a race between the two

@crosbymichael

crosbymichael Jun 5, 2014

Contributor

You cannot move this, we moved this before changing the state because there is a race between the two that causes a panic.

The real fix for this is that we don't have the same information in two places ( wait lock and State ), until then there will always be a race between the two

This comment has been minimized.

@LK4D4

LK4D4 Jun 5, 2014

Contributor

Ah, ok, I'll drop this commit then

@LK4D4

LK4D4 Jun 5, 2014

Contributor

Ah, ok, I'll drop this commit then

This comment has been minimized.

@LK4D4

LK4D4 Jun 5, 2014

Contributor

Hmmm, can I move it between ToDisk and changing state? because race in ToDisk really

@LK4D4

LK4D4 Jun 5, 2014

Contributor

Hmmm, can I move it between ToDisk and changing state? because race in ToDisk really

This comment has been minimized.

@crosbymichael

crosbymichael Jun 5, 2014

Contributor

It has to be before we update the container.State

@crosbymichael

crosbymichael Jun 5, 2014

Contributor

It has to be before we update the container.State

@LK4D4

This comment has been minimized.

Show comment
Hide comment
@LK4D4

LK4D4 Jun 5, 2014

Contributor

@crosbymichael please take another look

Contributor

LK4D4 commented Jun 5, 2014

@crosbymichael please take another look

@LK4D4

This comment has been minimized.

Show comment
Hide comment
@LK4D4

LK4D4 Jun 6, 2014

Contributor

Dropped last commit. I'll prepare new PR with "wait" functions for State

Contributor

LK4D4 commented Jun 6, 2014

Dropped last commit. I'll prepare new PR with "wait" functions for State

LK4D4 added some commits Jun 5, 2014

Fix race in contStore.List
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Fix race in get/set HostConfig
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Fix race in LogEvent
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
@LK4D4

This comment has been minimized.

Show comment
Hide comment
Contributor

LK4D4 commented Jun 11, 2014

@unclejack

This comment has been minimized.

Show comment
Hide comment
@unclejack

unclejack Jun 11, 2014

Contributor

LGTM

Contributor

unclejack commented Jun 11, 2014

LGTM

@vieux

This comment has been minimized.

Show comment
Hide comment
@vieux

vieux Jun 11, 2014

Collaborator

LGTM

Collaborator

vieux commented Jun 11, 2014

LGTM

@vieux

This comment has been minimized.

Show comment
Hide comment
@vieux

vieux Jun 11, 2014

Collaborator

@crosbymichael can you please take a look also ?

Collaborator

vieux commented Jun 11, 2014

@crosbymichael can you please take a look also ?

for _, cont := range c.s {
containers.Add(cont)
}
+ c.Unlock()
containers.Sort()

This comment has been minimized.

@crosbymichael

crosbymichael Jun 12, 2014

Contributor

Should the lock be kept for the Sort?

@crosbymichael

crosbymichael Jun 12, 2014

Contributor

Should the lock be kept for the Sort?

This comment has been minimized.

@crosbymichael

crosbymichael Jun 12, 2014

Contributor

nvm ;)

@crosbymichael

crosbymichael Jun 12, 2014

Contributor

nvm ;)

@crosbymichael

This comment has been minimized.

Show comment
Hide comment
@crosbymichael

crosbymichael Jun 12, 2014

Contributor

LGTM

Contributor

crosbymichael commented Jun 12, 2014

LGTM

crosbymichael added a commit that referenced this pull request Jun 12, 2014

@crosbymichael crosbymichael merged commit 51b188c into moby:master Jun 12, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@vieux vieux added this to the 1.0.1 milestone Jun 12, 2014

@LK4D4 LK4D4 deleted the LK4D4:fix_some_more_race_conditions branch Jun 13, 2014

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