Skip to content
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

Azure Functions (.NET8,Isolated) execution stalled and in limbo after uncaught exception #10489

Closed
aaramians opened this issue Sep 24, 2024 · 4 comments

Comments

@aaramians
Copy link

Core Tools Version: 4.0.6280 Commit hash: N/A +421f0144b42047aa289ce691dc6db4fc8b6143e6 (64-bit)
Function Runtime Version: 4.834.3.22875
.NET 8 - Isolated

Steps:
Start with brand new template project on Azure Function and throw an exception:

        [Function("Function1")]
        public IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req)
        {
            throw new InvalidOperationException();

            _logger.LogInformation("C# HTTP trigger function processed a request.");
            return new OkObjectResult("Welcome to Azure Functions!");
        }
curl http://localhost:7135/api/Function1

Expectation:
The client stalls, the server also stalls
I was expecting the client connection to be dropped and server/host to fail the invocation.

The issue I encountered was more complex. If the intended design is to prevent exceptions from bubbling up to the framework for handling, I can understand that this may be the expected behavior, where middleware would be responsible for catching the exception. This was the approach I attempted; however, I was unable to close the connection or mark the invocation as failed, while using function context/GetHttpContext/GetInvocationResult/...

On the other hand, if the framework is expected to handle this, I wouldn't anticipate a stall scenario.

@bhagyshricompany
Copy link

@aaramians thanks for reporting will update you.

@bhagyshricompany
Copy link

@kshyju pls confirm and validate.

@satvu
Copy link
Member

satvu commented Nov 6, 2024

@aaramians Does this still repro if you use the latest available package here: https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore?

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

If you are not the original author (aaramians) and believe this issue is not stale, please comment with /bot not-stale and I will not close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants