Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ostree: use the same thread for ostree operations #461

Merged
merged 1 commit into from
May 30, 2018

Conversation

giuseppe
Copy link
Member

Since ostreedev/ostree#1555, locking is
enabled by default in OSTree. Unfortunately it uses thread-private
data and it breaks the Golang bindings. Force the same thread for the
write operations to the OSTree repository.

Signed-off-by: Giuseppe Scrivano [email protected]

Since ostreedev/ostree#1555, locking is
enabled by default in OSTree.  Unfortunately it uses thread-private
data and it breaks the Golang bindings.  Force the same thread for the
write operations to the OSTree repository.

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe
Copy link
Member Author

/cc @cgwalters @strigazi

@cgwalters
Copy link
Contributor

LGTM

@runcom
Copy link
Member

runcom commented May 30, 2018

LGTM

Approved with PullApprove

@@ -394,6 +395,9 @@ func (d *ostreeImageDestination) PutSignatures(ctx context.Context, signatures [
}

func (d *ostreeImageDestination) Commit(ctx context.Context) error {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
Copy link
Member

Choose a reason for hiding this comment

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

For reference, this is generally unsafe to do https://go-review.googlesource.com/c/go/+/45752, but actually depends on the consumer of this and the go toolchain/runtime in use.

@mtrmac
Copy link
Collaborator

mtrmac commented May 30, 2018

👍 Thanks!

Approved with PullApprove

@mtrmac mtrmac merged commit a6bfd83 into containers:master May 30, 2018
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.

5 participants