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 <gscrivan@redhat.com>
  • Loading branch information
gaveen3 committed Sep 26, 2027
1 parent aad9483 commit dd8c5bc
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 dd8c5bc

Please sign in to comment.