azservicebus.Receiver.ReceiveMessages ignoring context timeout #17979
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Bus
Bug Report
github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus v0.4.1
go version go1.18.1 linux/amd64
From what I can see, azservicebus.Receiver.ReceiveMessages hangs when no messages are present in the queue. The call does not cancel according to context timeout setting (either customer set or internally). This makes it tricky to write KEDA driven serverless customer code for e.g. container apps
Preferred that ReceiveMessages times out based on the customer controlled setting, or the internal values if required (20ms/1second)
Please request if you would like me to provide some code to run
n/a
fetchMessages doesnt yield to context timeout
defaultTimeAfterFirstMessage is set to 20ms or 1 second.
I propose a change to fetchMessages something like the below
Note: due to the interfacing its unclear to me whether the same change is required in internal.AMQPReceiver, but a quick look at Receive makes it looks like it handles things ok there
The text was updated successfully, but these errors were encountered: