Admiral-Piett / goaws

AWS (SQS/SNS) Clone for Development testing
MIT License
779 stars 144 forks source link

Fix panic for concurrent DeleteQueue & ReceiveMessage #201

Closed sebcante closed 4 years ago

sebcante commented 4 years ago

Hi @p4tin,

Hope we can merge the below bug fix, thanks!

Fixes panic at goaws/app/gosqs/gosqs.go:376. use case DeleteQueue() while something is still blocked by ReceiveMessage()

Fixes the below panic in ReceiveMessage


goroutine 50 [running]:
github.com/sebcante/goaws/app/gosqs.ReceiveMessage(0x13fe060, 0xc000088ac0, 0xc0001ce800)
        github.com/sebcante/goaws/app/gosqs/gosqs.go:376 +0x410
net/http.HandlerFunc.ServeHTTP(...)
        /Users/seb/ap/bin/gobin/go/src/net/http/server.go:1995
github.com/sebcante/goaws/app/gosqs.TestReceiveMessage_WithConcurrentDeleteQueue.func1(0xc000018b20, 0xc000163c00)
        github.com/sebcante/goaws/app/gosqs/gosqs_test.go:1081 +0x344
created by github.com/sebcante/goaws/app/gosqs.TestReceiveMessage_WithConcurrentDeleteQueue
        github.com/sebcante/goaws/app/gosqs/gosqs_test.go:1065 +0x482"
sebcante commented 4 years ago

Hi @p4tin, would you have any pointer on the travis error?, is that something you saw before? happy to jump on it asap

The command "eval go get -v -t ./... " failed. Retrying, 2 of 3.
package math/bits: unrecognized import path "math/bits" (import path does not begin with hostname)

https://travis-ci.org/p4tin/goaws/jobs/589937679

p4tin commented 4 years ago

I have never seen that error in travis CI

p4tin commented 4 years ago

I see it in other PRs as well - I cannot troubleshoot that right now but I will this weekend - in the meantime let me know if you find a reason why...