Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Data race on _escFile.name #65

Open
zikaeroh opened this issue Jan 19, 2020 · 0 comments
Open

Data race on _escFile.name #65

zikaeroh opened this issue Jan 19, 2020 · 0 comments

Comments

@zikaeroh
Copy link

I hit this data race in my CI:

==================
WARNING: DATA RACE
Read at 0x00c0000d2a68 by goroutine 7:
  github.com/hortbot/hortbot/internal/db/migrations/esc.(*_escFile).Name()
      /home/travis/gopath/src/github.com/hortbot/hortbot/internal/db/migrations/esc/esc.go:130 +0x3e
  github.com/golang-migrate/migrate/v4/source/httpfs.(*PartialDriver).Init()
      /home/travis/gopath/pkg/mod/github.com/golang-migrate/migrate/[email protected]/source/httpfs/partial_driver.go:48 +0x34c
  github.com/golang-migrate/migrate/v4/source/httpfs.New()
      /home/travis/gopath/pkg/mod/github.com/golang-migrate/migrate/[email protected]/source/httpfs/driver.go:21 +0xaf
  github.com/hortbot/hortbot/internal/db/migrations.newMigrate()
      /home/travis/gopath/src/github.com/hortbot/hortbot/internal/db/migrations/migrations.go:51 +0x77
  github.com/hortbot/hortbot/internal/db/migrations.Up()
      /home/travis/gopath/src/github.com/hortbot/hortbot/internal/db/migrations/migrations.go:15 +0x8d
  github.com/hortbot/hortbot/internal/db/migrations_test.withDatabase()
      /home/travis/gopath/src/github.com/hortbot/hortbot/internal/db/migrations/migrations_test.go:67 +0x11e
  github.com/hortbot/hortbot/internal/db/migrations_test.TestUp()
      /home/travis/gopath/src/github.com/hortbot/hortbot/internal/db/migrations/migrations_test.go:33 +0x52
  testing.tRunner()
      /home/travis/.gimme/versions/go/src/testing/testing.go:993 +0x1eb

Previous write at 0x00c0000d2a68 by goroutine 77:
  github.com/hortbot/hortbot/internal/db/migrations/esc._escStaticFS.prepare.func1()
      /home/travis/gopath/src/github.com/hortbot/hortbot/internal/db/migrations/esc/esc.go:59 +0xad
  sync.(*Once).doSlow()
      /home/travis/.gimme/versions/go/src/sync/once.go:66 +0x103
  sync.(*Once).Do()
      /home/travis/.gimme/versions/go/src/sync/once.go:57 +0x68
  github.com/hortbot/hortbot/internal/db/migrations/esc._escStaticFS.prepare()
      /home/travis/gopath/src/github.com/hortbot/hortbot/internal/db/migrations/esc/esc.go:58 +0x160
  github.com/hortbot/hortbot/internal/db/migrations/esc._escStaticFS.Open()
      /home/travis/gopath/src/github.com/hortbot/hortbot/internal/db/migrations/esc/esc.go:78 +0x46
  github.com/hortbot/hortbot/internal/db/migrations/esc.(*_escStaticFS).Open()
      <autogenerated>:1 +0x5f
  github.com/golang-migrate/migrate/v4/source/httpfs.(*PartialDriver).ReadUp()
      /home/travis/gopath/pkg/mod/github.com/golang-migrate/migrate/[email protected]/source/httpfs/partial_driver.go:111 +0x1b9
  github.com/golang-migrate/migrate/v4/source/httpfs.(*driver).ReadUp()
      <autogenerated>:1 +0x5b
  github.com/golang-migrate/migrate/v4.(*Migrate).newMigration()
      /home/travis/gopath/pkg/mod/github.com/golang-migrate/migrate/[email protected]/migrate.go:837 +0x96
  github.com/golang-migrate/migrate/v4.(*Migrate).readUp()
      /home/travis/gopath/pkg/mod/github.com/golang-migrate/migrate/[email protected]/migrate.go:612 +0x22b

It appears as though there's a path where the static file is being returned before it has been prepared, but I can't see how at first glance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant