Reputation: 25
I have an Azure function running on Consumption Flex that was silently stoped three times during the last two days. It runs using python v2.
The function does't show in the invocations at all, so it looks like it never got triggered. But I know that it has started and worked for around 2 mins (as I see the results of it) and then just silently stops. When I open "Disagnose and solve problems" -> "Availability and Performance" I see this:
But I don't know if this can help me because the functions stops just after a couple of minutes.
In the Logs -> Traces, I see that it just stops emitting the traces in the middle of the process:
My fucntion is request heavy and uses requests.Session, but every call has a timeout defined. When I run the function locally it completes without any problem.
Also, I use try-catch block inside the main funtion, which would make me think that if an exception would occure, it would trigger the exception block. I don't use async. When I use Live metrics during the function execution I see quite a few servers being dedicated (can be 6-8), while the cpu and memory stays at extremely low levels.
I have been running the same code in Functions for more than 3 months without any issue, but as I mentinoed before I have had three silent stops during the short period.
Can anyone please help me investigate the issue?
Upvotes: 0
Views: 43
Reputation: 72
We had this kind of behaviour in one of our implementation with C# code in Azure Function and we found that restricting the Azure Function instance has resolved this issue. Our Azure Function was also making web request to SAP and we had the same issue. Here is what we did in the host.json to resolve the issue.
{
"version": "2.0",
"functionAppScaleLimit": 1
}
Also see if Durable function can help you out.
Upvotes: 0