Azure / azure-functions-servicebus-extension

Service Bus extension for Azure Functions
MIT License
65 stars 35 forks source link

ServicebusTrigger with Sessions enabled causes UserErrors on SB Metrics #51

Open lukasvosyka opened 4 years ago

lukasvosyka commented 4 years ago

Hi,

we are experiencing a hugh number on "User Errors" within our ServiceBus Metrics, but somehow we cannot figure out what the root cause is. One thing that we observe is, when we split the metrics on EntityName level, only sessions enabled queues and topics seem to be affected.

I did a small repro in an isolated setup, and can confirm that the "User Errors" metrics go up, while the function execution runs without any problems and no errors are generated.

function-sb-sessions-test.zip

Now I am wondering whether it could be connected to some internal stuff going on, maybe when the session lock is being renewed or something similar?

Attached you can find the repro. It has a service bus trigger with IsSessionsEnabled=true and an HttpTrigger to feed the service bus with messages. Once the service bus is fed with messages, the service bus trigger starts working, and the User Error metrics start raising..

image

Is there anything we can do to prevent these User errors or is this something for you? @alrod

Update: I just tried the repro, without invocation at all and it is also raising "User errors" even when the Service bus trigger is not fired at all. It seems the the pure existance of the ServiceBusTrigger causes "User errors" being reported to the attached Service Bus entity.

Update2: I can confirm, that using ServiceBusTrigger without IsSessionsEnabled=true is not causing these "User Errors" on the Service Bus Metrics. This seems to be related to Sessions enabled only.

Thanks, Lukas

lukasvosyka commented 4 years ago

Hi @alrod

do you have any news on this? Are you able to repro?

Best, Lukas

vnbaaij commented 4 years ago

Hi,

One of our customers is seeing the same happening with session enabled (to get FIFO order processing) Service bus Queues and Topics kicking off various webjobs. The number of errors is proportional to the number of listeners (“MaxConcurrentSessions”) and not related to the amount of actual messages. The errors don’t seem to cause any adverse behavior, but it’s still strange.

Is there any update available on the status of this issue? Thanks.

lukasvosyka commented 4 years ago

Maybe it helps... I figured that the SB SDK is also causing this issue when running as console app together with default DI app insights registration. I believe it comes from this issue originally: https://github.com/microsoft/ApplicationInsights-dotnet/issues/1348

It was originally tracked here https://github.com/Azure/azure-sdk-for-net/issues/6813