Skip to content

Fix a race in daemon/logger/awslogs#22971

Closed
AkihiroSuda wants to merge 1 commit intomoby:masterfrom
AkihiroSuda:fix22963LogRace2
Closed

Fix a race in daemon/logger/awslogs#22971
AkihiroSuda wants to merge 1 commit intomoby:masterfrom
AkihiroSuda:fix22963LogRace2

Conversation

@AkihiroSuda
Copy link
Member

- What I did
Fixed a race found in #22963

- How I did it
Copied a slice to avoid the race

- How to verify it
TESTDIRS=daemon/logger/awslogs BUILDFLAGS=-race TESTFLAGS="-test.count 100" make test-unit

Fix #22963 (with #22969)
Signed-off-by: Akihiro Suda suda.akihiro@lab.ntt.co.jp


PTAL @samuelkarp

Fix moby#22963 (with moby#22969)

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
@coolljt0725
Copy link
Contributor

LGTM

@vdemeester
Copy link
Member

LGTM 👍

@LK4D4
Copy link
Contributor

LK4D4 commented May 25, 2016

@AkihiroSuda I'd really prefer to solve it other way :/ because batch size is 10000. I don't know about real client, but if its PutLogEvents is blocking, then probably mockClient should do the same. If not - then I suppose this fix is good.

@samuelkarp
Copy link
Member

@AkihiroSuda Thanks for finding this race! I've opened #22985, which fixes the same race while avoiding copying a slice that could have 10000 elements.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants