matryer / vice

Go channels at horizontal scale (powered by message queues)
https://medium.com/@matryer/introducing-vice-go-channels-across-many-machines-bcac1147d7e2
Apache License 2.0
1.54k stars 79 forks source link

sqs: data race #27

Closed HeavyHorst closed 7 years ago

HeavyHorst commented 7 years ago
rkaufmann@chefkaufmann ..src/github.com/matryer/vice/queues/sqs (git)-[redis] % go test -v -race .
=== RUN   TestTransport
=== RUN   TestTransport/testStandardTransportBehaviour
==================
WARNING: DATA RACE
Write at 0x00c420141350 by goroutine 11:
  runtime.mapassign_faststr()
      /usr/local/go/src/runtime/hashmap_fast.go:598 +0x0
  github.com/matryer/vice/queues/sqs.(*mockSQSClient).ReceiveMessage()
      /home/rkaufmann/go/src/github.com/matryer/vice/queues/sqs/sqs_test.go:65 +0x648
  github.com/matryer/vice/queues/sqs.(*Transport).makeSubscriber.func1()
      /home/rkaufmann/go/src/github.com/matryer/vice/queues/sqs/sqs.go:96 +0xac

Previous read at 0x00c420141350 by goroutine 10:
  runtime.mapaccess1_faststr()
      /usr/local/go/src/runtime/hashmap_fast.go:208 +0x0
  github.com/matryer/vice/queues/sqs.(*mockSQSClient).ReceiveMessage()
      /home/rkaufmann/go/src/github.com/matryer/vice/queues/sqs/sqs_test.go:73 +0x223
  github.com/matryer/vice/queues/sqs.(*Transport).makeSubscriber.func1()
      /home/rkaufmann/go/src/github.com/matryer/vice/queues/sqs/sqs.go:96 +0xac

Goroutine 11 (running) created at:
  github.com/matryer/vice/queues/sqs.(*Transport).makeSubscriber()
      /home/rkaufmann/go/src/github.com/matryer/vice/queues/sqs/sqs.go:90 +0x2e6
  github.com/matryer/vice/queues/sqs.(*Transport).Receive()
      /home/rkaufmann/go/src/github.com/matryer/vice/queues/sqs/sqs.go:64 +0x1b6
  github.com/matryer/vice/vicetest.testStandardTransportBehaviour.func2()
      /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:77 +0x224

Goroutine 10 (running) created at:
  github.com/matryer/vice/queues/sqs.(*Transport).makeSubscriber()
      /home/rkaufmann/go/src/github.com/matryer/vice/queues/sqs/sqs.go:90 +0x2e6
  github.com/matryer/vice/queues/sqs.(*Transport).Receive()
      /home/rkaufmann/go/src/github.com/matryer/vice/queues/sqs/sqs.go:64 +0x1b6
  github.com/matryer/vice/vicetest.testStandardTransportBehaviour.func2()
      /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:67 +0x104
==================
=== RUN   TestTransport/testSendChannelsDontBlock
--- FAIL: TestTransport (0.01s)
    --- FAIL: TestTransport/testStandardTransportBehaviour (0.01s)
        testing.go:700: race detected during execution of test
    --- FAIL: TestTransport/testSendChannelsDontBlock (0.00s)
        testing.go:700: race detected during execution of test
=== RUN   TestParseRegion
--- FAIL: TestParseRegion (0.00s)
FAIL
exit status 1
FAIL    github.com/matryer/vice/queues/sqs      0.022s