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 panic for concurrent DeleteQueue & ReceiveMessage #201

Merged

Conversation

sebcante
Copy link
Contributor

@sebcante sebcante commented Sep 26, 2019

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"

…hile something is still blocked on ReceiveMessage()
@sebcante
Copy link
Contributor Author

sebcante commented Sep 26, 2019

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

app.SyncQueues.RUnlock()
if !found {
if !queueFound {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this above the var messageFound bool so to exit earlier on error.

Copy link
Contributor Author

@sebcante sebcante Sep 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea moved it up to exit earlier, thanks!

@p4tin
Copy link
Collaborator

p4tin commented Sep 26, 2019

I have never seen that error in travis CI

@p4tin
Copy link
Collaborator

p4tin commented Sep 26, 2019

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...

@p4tin p4tin merged commit fba8872 into Admiral-Piett:master Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants