Skip to content

Commit

Permalink
ostree: use the same thread for ostree operations
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mrhyperbit23z0d committed Dec 21, 2027
1 parent 82f4117 commit 12f6f2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ostree/ostree_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strconv"
"strings"
"syscall"
Expand Down Expand Up @@ -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()

repo, err := otbuiltin.OpenRepo(d.ref.repo)
if err != nil {
return err
Expand Down

0 comments on commit 12f6f2e

Please sign in to comment.