Azure / Azure/azure-functions-host
Background threads not being stopped during shutdown
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
It appears there are cases where calling `HostingEnvironment.InitiateShutdown()` will not stop all background threads. This means that if someone is in this situation and has exceeded the thread count threshold, they will infinitely repeat starting/stopping the host (due to the Health Monitor shutting it down). Only restarting the site manually will fix it.
Found this which has some examples: https://stackoverflow.com/questions/4432141/how-to-properly-unload-an-appdomain-using-c/5863164
I'm waiting on a concrete sample from this customer. When we have it, I'll do some more investigation into whether this is something we can help with.
Contributor guide
Assessment
This issue has not been assessed yet.