Skip to content

Protect node.ents and node.entsCached with a mutex in fs/layer/node.go - #1381

Merged
ktock merged 1 commit into
containerd:mainfrom
iain-macdonald:main
Sep 13, 2023
Merged

ktock merged 1 commit into
containerd:mainfrom
iain-macdonald:main

Conversation

@iain-macdonald

Copy link
Copy Markdown
Contributor

We run a modified version of the soci-snapshotter (which is based on the stargz-snapshotter) in production at BuildBuddy and recently enabled the golang race detector in our dev environment. It flagged racy accesses to node.ents and node.entsCached, here are the logs (line numbers should be the same). This commit protects access to those two fields with a mutex.

We run a modified version of the soci-snapshotter (which is based on the stargz-snapshotter) in production at BuildBuddy and recently enabled the golang race detector in our dev environment. It flagged racy accesses to node.ents and node.entsCached. This commit protects access to those two fields with a mutex.

Signed-off-by: Iain Macdonald <xiainx@gmail.com>

@ktock ktock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ktock
ktock merged commit 7275d45 into containerd:main Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants