Azure / Azure/azure-functions-host

Background threads not being stopped during shutdown

Open
#2,729 2 comments 0 reactions 1 assignee Claimed by @mathewc View on GitHub
1.x enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.