Open cgillum opened 6 years ago
Potentially related to https://github.com/Azure/azure-functions-host/issues/2907
@brettsam Didn't you commit a change fixing this?
There's been a fix to the v1 ScriptHost leaks, yes. (https://github.com/Azure/azure-webjobs-sdk/pull/1971)
But someone can create a leak themselves. They could add to a static List in each invocation, for example.
The issue here seems to be that when we do get into that scenario, we can't recover without a manual reset. I know we have code checking IsFatal()
in a couple of places -- maybe we're missing it here?
@brettsam any update here? We seem to have created a our own leak and requiring manual intervention is not ideal. Any idea what the timing for a fix is, or if there is a workaround to automatically resetting a failed host?
@mwolin-gcmlp and @cgillum Can you elaborate on the scenario that would lead to OutOfMemory exception but not cause host to crash. We need to be able to understand / reproduce this to put the correct fix in.
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.
@soninaren this was quite some time ago and I don't imagine we have the code available. However, from the call stack you can see that the OutOfMemoryException happens in the C# script code, so I think the repro would be:
If you can successfully invoke another function after the OutOfMemoryException then I think we can go ahead and close this issue.
Investigative information
Summary
The functions host (1.0) was shutdown due to an OutOfMemoryException. The functions host failed to restart itself after being in this condition. The process was kept alive by AlwaysOn, but the host didn't restart until a restart command was manually sent to the App Service infrastructure
Here is the callstack of the OutOfMemoryException. Note that it happens in user code:
Functions logs at the time:
Expected behavior
The functions host should automatically restart after shutting down.
Actual behavior
The functions host stayed in a shutdown state. It continued to respond successfully to ping requests from AlwaysOn.
Known workarounds
Manually restart the function app when it gets into this state.