Azure / Azure/azure-functions-host
Function (v2) hangs on Debug.Assert
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
#### Investigative information
- Timestamp: 2019-12-19 11:35:11.873
- Function App version: 2.0
- Invocation ID: e21b1d19-c232-4785-8451-0278fe737214
- Region: West Europe
Note: The invocation id is the last successful completion right before the problem happened. The issue appeared right after that but the execution did not complete, hence there is no log available.
#### Repro steps
1. Write a simple function with `Debug.Assert(false)` in the main method
2. Deploy the function in the Debug configuration
3. Trigger the function.
#### Expected behavior
The function should either run to completion or throw.
#### Actual behavior
The runtime goes into break mode and will not continue until shut down for timing out some minutes later. No new requests will be processed during this time, the function is essentially unusable. It also does not complete and log anything, so the issue is difficult to identify.
#### Known workarounds
I tried `Trace.Listeners.Clear()`, with no change in the observed behavior.
Deploying in release mode circumvents the assertion, but I want to deploy for debugging on the developer version of the function. I can not remove or fix the specific assertion since it is tripped in a library.
Contributor guide
Research direction
Start by reproducing the issue with a C# Azure Functions v2 app containing Debug.Assert(false), deployed in Debug configuration. Inspect the host's handling of assertion-triggered break mode and compare it with the expected throw-or-complete behavior; done means the invocation does not hang, blocks later requests, or time out silently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100