Skip to content

Conversation

@stbenjam
Copy link
Member

Due to a race condition in Docker[1], we need to disable extraction
using unpigz. Currently this is done in the image extraction code,
however this code is multi-threaded. Setenv is not thread safe in C[2],
so even thought it is safe in go[3], there's a small risk if there's
any C threads running.

It's safer to just set this env variable once when oc starts, rather
every time the layerByEntry function is called.

[1] moby/moby#39859
[2] rust-lang/rust#24741
[3] https://github.com/golang/go/blob/a38a917aee626a9b9d5ce2b93964f586bf759ea0/src/syscall/env_unix.go#L18

Due to a race condition in Docker[1], we need to disable extraction
using unpigz. Currently this is done in the image extraction code,
however this code is multi-threaded.  Setenv is not thread safe in C[2],
so even thought it is safe in go[3], there's a small risk if there's
any C threads running.

It's safer to just set this env variable once when `oc` starts, rather
every time the layerByEntry function is called.

[1] moby/moby#39859
[2] rust-lang/rust#24741
[3] https://github.com/golang/go/blob/a38a917aee626a9b9d5ce2b93964f586bf759ea0/src/syscall/env_unix.go#L18
@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 18, 2019
@cgwalters
Copy link
Member

/approve

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 18, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, soltysh, stbenjam

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 18, 2019
@openshift-merge-robot openshift-merge-robot merged commit 3780d2d into openshift:master Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants