We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello
we discover a possible race condition on batcher since version go-resiliency 1.4 and 1.5
Here is a minimal example with a test that trigger this issue
I tested with latest go (1.22) and go-resiliency 1.5
source code is available here https://github.com/peczenyj/example-race
package: https://github.com/peczenyj/example-race/blob/main/foo/foo.go
test: https://github.com/peczenyj/example-race/blob/main/foo/foo_test.go
$ go test -race ./foo/... ================== WARNING: DATA RACE Write at 0x00c00009eec8 by goroutine 7: github.com/eapache/go-resiliency/batcher.(*Batcher).submitWork() /home/weborama.office/tiago/work/go/src/github.com/peczenyj/example-race/vendor/github.com/eapache/go-resiliency/batcher/batcher.go:74 +0xed github.com/eapache/go-resiliency/batcher.(*Batcher).Run() /home/weborama.office/tiago/work/go/src/github.com/peczenyj/example-race/vendor/github.com/eapache/go-resiliency/batcher/batcher.go:55 +0x20e github.com/peczenyj/example-race/foo.(*Foo).Get() /home/weborama.office/tiago/work/go/src/github.com/peczenyj/example-race/foo/foo.go:36 +0x2e7 github.com/peczenyj/example-race/foo_test.TestBatcher() /home/weborama.office/tiago/work/go/src/github.com/peczenyj/example-race/foo/foo_test.go:23 +0x2e8 testing.tRunner() /usr/local/go1.22.0/src/testing/testing.go:1689 +0x21e testing.(*T).Run.gowrap1() /usr/local/go1.22.0/src/testing/testing.go:1742 +0x44 Previous read at 0x00c00009eec8 by goroutine 8: github.com/eapache/go-resiliency/batcher.(*Batcher).batch() /home/weborama.office/tiago/work/go/src/github.com/peczenyj/example-race/vendor/github.com/eapache/go-resiliency/batcher/batcher.go:100 +0x3d8 github.com/eapache/go-resiliency/batcher.(*Batcher).submitWork.gowrap2() /home/weborama.office/tiago/work/go/src/github.com/peczenyj/example-race/vendor/github.com/eapache/go-resiliency/batcher/batcher.go:76 +0x33 Goroutine 7 (running) created at: testing.(*T).Run() /usr/local/go1.22.0/src/testing/testing.go:1742 +0x825 testing.runTests.func1() /usr/local/go1.22.0/src/testing/testing.go:2161 +0x85 testing.tRunner() /usr/local/go1.22.0/src/testing/testing.go:1689 +0x21e testing.runTests() /usr/local/go1.22.0/src/testing/testing.go:2159 +0x8be testing.(*M).Run() /usr/local/go1.22.0/src/testing/testing.go:2027 +0xf17 main.main() _testmain.go:49 +0x2bd Goroutine 8 (finished) created at: github.com/eapache/go-resiliency/batcher.(*Batcher).submitWork() /home/weborama.office/tiago/work/go/src/github.com/peczenyj/example-race/vendor/github.com/eapache/go-resiliency/batcher/batcher.go:76 +0x1ef github.com/eapache/go-resiliency/batcher.(*Batcher).Run() /home/weborama.office/tiago/work/go/src/github.com/peczenyj/example-race/vendor/github.com/eapache/go-resiliency/batcher/batcher.go:55 +0x20e github.com/peczenyj/example-race/foo.(*Foo).Get() /home/weborama.office/tiago/work/go/src/github.com/peczenyj/example-race/foo/foo.go:36 +0x283 github.com/peczenyj/example-race/foo_test.TestBatcher() /home/weborama.office/tiago/work/go/src/github.com/peczenyj/example-race/foo/foo_test.go:22 +0x284 testing.tRunner() /usr/local/go1.22.0/src/testing/testing.go:1689 +0x21e testing.(*T).Run.gowrap1() /usr/local/go1.22.0/src/testing/testing.go:1742 +0x44 ================== --- FAIL: TestBatcher (2.01s) testing.go:1398: race detected during execution of test FAIL FAIL github.com/peczenyj/example-race/foo 2.017s FAIL
while using go-resiliency 1.3 there is no race
$ go test -race ./foo/... ok github.com/peczenyj/example-race/foo 3.016s
regards
The text was updated successfully, but these errors were encountered:
Thanks for the report, I made a few other small improvements while I was cleaning this up!
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Hello
we discover a possible race condition on batcher since version go-resiliency 1.4 and 1.5
Here is a minimal example with a test that trigger this issue
I tested with latest go (1.22) and go-resiliency 1.5
source code is available here https://github.com/peczenyj/example-race
package: https://github.com/peczenyj/example-race/blob/main/foo/foo.go
test: https://github.com/peczenyj/example-race/blob/main/foo/foo_test.go
while using go-resiliency 1.3 there is no race
regards
The text was updated successfully, but these errors were encountered: