spezam/eventbridge-cli

leaking goroutine in sqs.pollQueue

Closed this issue · 0 comments

In case of error or network issues, ReceiveMessageRequest might return an err.

resp, err := s.client.ReceiveMessageRequest(&sqs.ReceiveMessageInput{})

which makes the wrapping go routine not close properly, and temporary resources cleanup not being performed.
Example behavior during a network disconnection:

2020/04/01 16:53:58 sqs.ReceiveMessage error: exceeded maximum number of attempts, 3, request send failed, Post "https://sqs.eu-west-1.amazonaws.com/": dial tcp: lookup sqs.eu-west-1.amazonaws.com: no such host

^C2020/04/01 22:48:05 received an interrupt, cleaning up...
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C