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

fix data race and remove oxy v1 #185

Merged
merged 1 commit into from
Sep 6, 2024
Merged

Conversation

brianonn
Copy link
Contributor

@brianonn brianonn commented Sep 6, 2024

Description

  1. removes the final dependancy on github.com/vulcand/oxy V1 which requires gocheck and that requires Bazaar VCS. Oxy V2 is the current version and does not import gocheck, thus eliminating the need for Bazaar VCS (bzr)
  2. Fixes a data race condition in the publisher

Motivation and Context

  1. removes the need for the bazaar binary when everything else uses git
  2. Fixes a data race in the publisher.

How Has This Been Tested?

using make test

Output after the fix is applied:

$ make test
go test ./... -race -cover -covermode=atomic -coverprofile=unit_coverage.out
# go.aporeto.io/bahamut/gateway/upstreamer/push.test
ok      go.aporeto.io/bahamut   107.834s        coverage: 90.8% of statements
ok      go.aporeto.io/bahamut/authorizer/mtls   51.784s coverage: 97.7% of statements
ok      go.aporeto.io/bahamut/authorizer/simple 51.676s coverage: 100.0% of statements
ok      go.aporeto.io/bahamut/gateway   53.187s coverage: 93.2% of statements
ok      go.aporeto.io/bahamut/gateway/upstreamer/push   86.967s coverage: 94.2% of statements

Screenshots showing the data race bug

WARNING: DATA RACE
Write at 0x00c0003b01d8 by goroutine 20:
  go.aporeto.io/bahamut.(*Publication).EncodeWithEncoding()
      /Users/bonn/Repos/bahamut/publication.go:92 +0x6c
  go.aporeto.io/bahamut.(*Publication).Encode()
      /Users/bonn/Repos/bahamut/publication.go:81 +0x44
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier.func1.1.2.(*Notifier).MakeStartHook.3.1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier.go:115 +0x2e8

Previous read at 0x00c0003b01d8 by goroutine 21:
  go.aporeto.io/bahamut.(*Publication).Duplicate()
      /Users/bonn/Repos/bahamut/publication.go:152 +0x18c
  go.aporeto.io/bahamut.(*localPubSub).listen.func1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:135 +0x3e8
  go.aporeto.io/bahamut.(*localPubSub).listen.gowrap1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:136 +0x54

Goroutine 20 (running) created at:
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier.func1.1.2.(*Notifier).MakeStartHook.3()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier.go:103 +0x6a0
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier.func1.1.2()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:80 +0x120
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.(*context).Convey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:166 +0x6c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:19 +0x164
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.(*context).Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:165 +0x62c
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:78 +0x84
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier.func1.1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:73 +0x5e4
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.(*context).Convey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:166 +0x6c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:19 +0x164
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.(*context).Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:165 +0x62c
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:78 +0x84
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier.func1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:39 +0x5a0
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.rootConvey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:112 +0x16c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0x3c
  github.com/jtolds/gls._m()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:108 +0x38
  github.com/jtolds/gls.github_com_jtolds_gls_markS()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:56 +0x30
  github.com/jtolds/gls.addStackTag()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:49 +0x130
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0xb8
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.rootConvey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:107 +0x4a0
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:76 +0x98
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:17 +0x98
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.22.5/libexec/src/testing/testing.go:1689 +0x180
  testing.(*T).Run.gowrap1()
      /opt/homebrew/Cellar/go/1.22.5/libexec/src/testing/testing.go:1742 +0x40

Goroutine 21 (finished) created at:
  go.aporeto.io/bahamut.(*localPubSub).listen()
      /Users/bonn/Repos/bahamut/pubsub_local.go:133 +0x54c
  go.aporeto.io/bahamut.(*localPubSub).Connect.gowrap1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:80 +0x34
==================
==================
WARNING: DATA RACE
Write at 0x00c0003b01c8 by goroutine 20:
  go.aporeto.io/bahamut.(*Publication).EncodeWithEncoding()
      /Users/bonn/Repos/bahamut/publication.go:93 +0xb4
  go.aporeto.io/bahamut.(*Publication).Encode()
      /Users/bonn/Repos/bahamut/publication.go:81 +0x44
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier.func1.1.2.(*Notifier).MakeStartHook.3.1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier.go:115 +0x2e8

Previous read at 0x00c0003b01c8 by goroutine 21:
  go.aporeto.io/bahamut.(*Publication).Duplicate()
      /Users/bonn/Repos/bahamut/publication.go:156 +0x2f4
  go.aporeto.io/bahamut.(*localPubSub).listen.func1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:135 +0x3e8
  go.aporeto.io/bahamut.(*localPubSub).listen.gowrap1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:136 +0x54

Goroutine 20 (running) created at:
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier.func1.1.2.(*Notifier).MakeStartHook.3()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier.go:103 +0x6a0
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier.func1.1.2()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:80 +0x120
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.(*context).Convey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:166 +0x6c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:19 +0x164
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.(*context).Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:165 +0x62c
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:78 +0x84
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier.func1.1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:73 +0x5e4
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.(*context).Convey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:166 +0x6c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:19 +0x164
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.(*context).Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:165 +0x62c
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:78 +0x84
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier.func1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:39 +0x5a0
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.rootConvey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:112 +0x16c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0x3c
  github.com/jtolds/gls._m()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:108 +0x38
  github.com/jtolds/gls.github_com_jtolds_gls_markS()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:56 +0x30
  github.com/jtolds/gls.addStackTag()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:49 +0x130
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0xb8
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.rootConvey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:107 +0x4a0
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:76 +0x98
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestNonNotifier()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:17 +0x98
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.22.5/libexec/src/testing/testing.go:1689 +0x180
  testing.(*T).Run.gowrap1()
      /opt/homebrew/Cellar/go/1.22.5/libexec/src/testing/testing.go:1742 +0x40

Goroutine 21 (finished) created at:
  go.aporeto.io/bahamut.(*localPubSub).listen()
      /Users/bonn/Repos/bahamut/pubsub_local.go:133 +0x54c
  go.aporeto.io/bahamut.(*localPubSub).Connect.gowrap1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:80 +0x34
==================
✔✔✔✔✔✔✔✔✔✔
      When I call MakeStopHook and call the hook 
        Then err should be nil ✔✔✔✔✔✔
        Then the pubsub should have received a push ✔✔✔✔✔✔


70 total assertions

    testing.go:1398: race detected during execution of test
--- FAIL: TestNonNotifier (3.01s)
=== RUN   TestPrefixedNotifier

  Given I have a pubsub client and a bahamut server 
    When I call NewNotifier 
      Then n should be correct ✔✔✔✔✔✔✔
      When I call MakeStartHook and call the hook 
        Then err should be nil ✔
        Then the pubsub should have received a push ✔✔✔✔✔✔
          Then I wait 1.5sec and I should get another pusb ==================
WARNING: DATA RACE
Write at 0x00c0000e0e58 by goroutine 40:
  go.aporeto.io/bahamut.(*Publication).EncodeWithEncoding()
      /Users/bonn/Repos/bahamut/publication.go:92 +0x6c
  go.aporeto.io/bahamut.(*Publication).Encode()
      /Users/bonn/Repos/bahamut/publication.go:81 +0x44
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier.func1.1.2.(*Notifier).MakeStartHook.3.1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier.go:115 +0x2e8

Previous read at 0x00c0000e0e58 by goroutine 41:
  go.aporeto.io/bahamut.(*Publication).Duplicate()
      /Users/bonn/Repos/bahamut/publication.go:152 +0x18c
  go.aporeto.io/bahamut.(*localPubSub).listen.func1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:135 +0x3e8
  go.aporeto.io/bahamut.(*localPubSub).listen.gowrap1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:136 +0x54

Goroutine 40 (running) created at:
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier.func1.1.2.(*Notifier).MakeStartHook.3()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier.go:103 +0x6a0
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier.func1.1.2()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:229 +0x120
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.(*context).Convey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:166 +0x6c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:19 +0x164
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.(*context).Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:165 +0x62c
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:78 +0x84
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier.func1.1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:222 +0x4b4
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.(*context).Convey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:166 +0x6c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:19 +0x164
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.(*context).Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:165 +0x62c
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:78 +0x84
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier.func1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:198 +0x488
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.rootConvey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:112 +0x16c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0x3c
  github.com/jtolds/gls._m()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:108 +0x38
  github.com/jtolds/gls.github_com_jtolds_gls_markS()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:56 +0x30
  github.com/jtolds/gls.addStackTag()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:49 +0x130
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0xb8
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.rootConvey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:107 +0x4a0
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:76 +0x98
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:179 +0x98
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.22.5/libexec/src/testing/testing.go:1689 +0x180
  testing.(*T).Run.gowrap1()
      /opt/homebrew/Cellar/go/1.22.5/libexec/src/testing/testing.go:1742 +0x40

Goroutine 41 (finished) created at:
  go.aporeto.io/bahamut.(*localPubSub).listen()
      /Users/bonn/Repos/bahamut/pubsub_local.go:133 +0x54c
  go.aporeto.io/bahamut.(*localPubSub).Connect.gowrap1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:80 +0x34
==================
==================
WARNING: DATA RACE
Write at 0x00c0000e0e48 by goroutine 40:
  go.aporeto.io/bahamut.(*Publication).EncodeWithEncoding()
      /Users/bonn/Repos/bahamut/publication.go:93 +0xb4
  go.aporeto.io/bahamut.(*Publication).Encode()
      /Users/bonn/Repos/bahamut/publication.go:81 +0x44
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier.func1.1.2.(*Notifier).MakeStartHook.3.1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier.go:115 +0x2e8

Previous read at 0x00c0000e0e48 by goroutine 41:
  go.aporeto.io/bahamut.(*Publication).Duplicate()
      /Users/bonn/Repos/bahamut/publication.go:156 +0x2f4
  go.aporeto.io/bahamut.(*localPubSub).listen.func1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:135 +0x3e8
  go.aporeto.io/bahamut.(*localPubSub).listen.gowrap1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:136 +0x54

Goroutine 40 (running) created at:
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier.func1.1.2.(*Notifier).MakeStartHook.3()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier.go:103 +0x6a0
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier.func1.1.2()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:229 +0x120
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.(*context).Convey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:166 +0x6c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:19 +0x164
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.(*context).Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:165 +0x62c
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:78 +0x84
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier.func1.1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:222 +0x4b4
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.(*context).Convey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:166 +0x6c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:19 +0x164
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.(*context).Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:165 +0x62c
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:78 +0x84
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier.func1()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:198 +0x488
  github.com/smartystreets/goconvey/convey.discover.parseAction.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:89 +0x30
  github.com/smartystreets/goconvey/convey.(*context).conveyInner()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:279 +0x1f0
  github.com/smartystreets/goconvey/convey.rootConvey.func1()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:112 +0x16c
  github.com/jtolds/gls.(*ContextManager).SetValues.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x4ac
  github.com/jtolds/gls.EnsureGoroutineId.func1()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0x3c
  github.com/jtolds/gls._m()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:108 +0x38
  github.com/jtolds/gls.github_com_jtolds_gls_markS()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:56 +0x30
  github.com/jtolds/gls.addStackTag()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:49 +0x130
  github.com/jtolds/gls.EnsureGoroutineId()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0xb8
  github.com/jtolds/gls.(*ContextManager).SetValues()
      /Volumes/Go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x260
  github.com/smartystreets/goconvey/convey.rootConvey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:107 +0x4a0
  github.com/smartystreets/goconvey/convey.Convey()
      /Volumes/Go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:76 +0x98
  go.aporeto.io/bahamut/gateway/upstreamer/push.TestPrefixedNotifier()
      /Users/bonn/Repos/bahamut/gateway/upstreamer/push/notifier_test.go:179 +0x98
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.22.5/libexec/src/testing/testing.go:1689 +0x180
  testing.(*T).Run.gowrap1()
      /opt/homebrew/Cellar/go/1.22.5/libexec/src/testing/testing.go:1742 +0x40

Goroutine 41 (finished) created at:
  go.aporeto.io/bahamut.(*localPubSub).listen()
      /Users/bonn/Repos/bahamut/pubsub_local.go:133 +0x54c
  go.aporeto.io/bahamut.(*localPubSub).Connect.gowrap1()
      /Users/bonn/Repos/bahamut/pubsub_local.go:80 +0x34
==================

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@brianonn brianonn merged commit bb4f4df into master Sep 6, 2024
3 checks passed
@brianonn brianonn deleted the bonn/fix-data-race-remove-oxy-v1 branch September 6, 2024 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants