-
Notifications
You must be signed in to change notification settings - Fork 190
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
[ServiceBusTrigger] The host is disposed and cannot be used #2730
Comments
Could this be related? #2687 |
It's possible although it's still hard to say. I'll keep an eye on your issue as well, thank you. |
We've got either the same or very similar issue. I've got a case open with Microsoft Azure support as well. We're on an elastic premium plan. Actually "comforting" to hear someone is seeing it on consumption. We weren't sure if it was something in the hosting plan. Will add details that were mildly annoying: |
We are facing the same issue, would be good if we could get an update about this, thanks!! |
This call stack is from the host and appears to be a duplicate of Azure/azure-functions-host#10478 Closing as a duplicate |
Description
Issue Summary:
Environment: Azure Functions in isolated worker mode, written in C#, running on a Consumption plan, with some ServiceBusTrigger with SessionEnabled = true.
Error Encountered: Sporadically, this exception is thrown, with 2 different stack traces.
Stack Trace 1:
Stack Trace 2:
Observations:
Occasionally, I notice the following behavior in the logs:
Starting JobHost
with categoryMicrosoft.Azure.WebJobs.Hosting.JobHostService
.Session initializing (SessionId=XXX, SessionLockedUntil=9/23/2024 8:13:48 AM +00:00)
with categoryMicrosoft.Azure.WebJobs.ServiceBus.Listeners.ServiceBusListener
.Stopping JobHost
with categoryMicrosoft.Azure.WebJobs.Hosting.JobHostService
.This sequence results in the JobHost stopping right after it starts, which leads to spammed exceptions:
The host is disposed and cannot be used
. This suggests that the host is shutting down right after initialization, which is causing issues with the listener objects.We have the MaxDeliveryCount setting configured to 10. Unfortunately, the subsequent attempts after the first failure are made on the same instance, which is stopped and therefore not functioning. I would have expected the retries to occur on a new, working instance.
Problem:
I don't understand why the JobHost starts and then immediately stops, causing this disposal issue.
Context:
The function app is running on the Consumption plan, which may have some relevance to the lifecycle management of the host.
The host.json I use:
Steps to reproduce
Create an Azure Functions in isolated worker mode, written in C#, running on a Consumption plan, with some ServiceBusTrigger with SessionEnabled = true.
Then send some messages randomly, until getting this error.
The text was updated successfully, but these errors were encountered: