image-automation-controller icon indicating copy to clipboard operation
image-automation-controller copied to clipboard

Data Race in SSH Managed Transport

Open pjbgf opened this issue 2 years ago • 0 comments

Intermittently a data race is being detected when running the controller's tests:

==================
WARNING: DATA RACE
Write at 0x00c000a63dc0 by goroutine 88:
  github.com/fluxcd/source-controller/pkg/git/libgit2/managed.(*sshSmartSubtransport).Close()
      /home/runner/go/pkg/mod/github.com/fluxcd/[email protected]/pkg/git/libgit2/managed/ssh.go:314 +0x97
  github.com/fluxcd/source-controller/pkg/git/libgit2/managed.(*sshSmartSubtransport).Action.func3()
      /home/runner/go/pkg/mod/github.com/fluxcd/[email protected]/pkg/git/libgit2/managed/ssh.go:252 +0x325
  github.com/fluxcd/source-controller/pkg/git/libgit2/managed.(*sshSmartSubtransport).Action·dwrap·2()
      /home/runner/go/pkg/mod/github.com/fluxcd/[email protected]/pkg/git/libgit2/managed/ssh.go:267 +0x39
Previous write at 0x00c000a63dc0 by goroutine 155:
  github.com/fluxcd/source-controller/pkg/git/libgit2/managed.(*sshSmartSubtransport).Close()
      /home/runner/go/pkg/mod/github.com/fluxcd/[email protected]/pkg/git/libgit2/managed/ssh.go:314 +0x97
  github.com/libgit2/git2go/v33.smartSubtransportCloseCallback()
      /home/runner/go/pkg/mod/github.com/libgit2/git2go/[email protected]/transport.go:409 +0x10d
  _cgoexp_2c6025d51ecc_smartSubtransportCloseCallback()
      _cgo_gotypes.go:9438 +0x5b
  runtime.cgocallbackg1()
      /opt/hostedtoolcache/go/1.17.11/x64/src/runtime/cgocall.go:306 +0x2ab
  github.com/libgit2/git2go/v33.(*Remote).Fetch.func2()
      /home/runner/go/pkg/mod/github.com/libgit2/git2go/[email protected]/remote.go:1044 +0xc9
  github.com/libgit2/git2go/v33.(*Remote).Fetch()
      /home/runner/go/pkg/mod/github.com/libgit2/git2go/[email protected]/remote.go:1044 +0x317
  github.com/fluxcd/source-controller/pkg/git/libgit2.(*CheckoutBranch).Checkout()

https://github.com/fluxcd/image-automation-controller/runs/7002619539?check_suite_focus=true

pjbgf avatar Jul 01 '22 15:07 pjbgf