Masterminds / glide

Package Management for Golang
https://glide.sh
Other
8.15k stars 541 forks source link

Consumer hang after failed to delete delivery from SQS FIFO #1049

Open feelinc opened 5 years ago

feelinc commented 5 years ago

Hi,

I tried using release v.1.5.1 and latest, with below SQS config

`var sqsClient = sqs.New(session.Must(session.NewSession(&aws.Config{ Region: aws.String("YOUR_AWS_REGION"), Credentials: credentials.NewStaticCredentials("YOUR_AWS_ACCESS_KEY", "YOUR_AWS_ACCESS_SECRET", ""), HTTPClient: &http.Client{ Timeout: time.Second * 120, }, })))

var visibilityTimeout = 20

&machineryCfg.SQSConfig{ Client: sqsClient, VisibilityTimeout: &visibilityTimeout, WaitTimeSeconds: 10, }`

The consumer just hang If a task took more than 20 seconds to complete, and need to restart the consumer manually.

The SQS error ERROR: 2019/03/17 04:14:27 sqs.go:232 error when deleting the delivery. the delivery is { Messages: [{ Attributes: { SentTimestamp: "1552751115642" }, Body: "{}", MD5OfBody: "", MessageId: "", ReceiptHandle: " }] }

The solution for now is to increase visibilityTimeout to prevent the consumer from hang.