question

MartinJrgensen-7072 avatar image
MartinJrgensen-7072 asked ·

Azure Function response times out, and tcp connection is reset (closed) before all content is received

Hi.

I am not sure, if this is the right forum.

We have an embedded device, which connects to an Azure Function and gets a 10MB file.
During the file transfer the connection is reset (TCP RST) or we see, that Azure is no longer sending data to the device, even though the device is capable of receiving data. It normally happens after minutes 5-10 minutes.

Using WireShark we are able to see, that even though the device sends "TCP Window Update", where "Win" size is more than the size of 1 TCP package, no new data is received. As a consequence, the embedded device times out waiting for data (set to 30 seconds i the test), and the embedded device sends an "ACK" and "FIN".

If the same device fetches the file from a Linux server, it works.

We know of "idle timeouts" of Azure Load Balancer, and "FunctionTimeout" if an Azure Function. But what are we missing?

The Azure Function is running on a WebApp plan, with always on enabled.

Best regards
Martin

azure-functionsazure-load-balancer
1 comment
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Do you have a code snippet showing how the function is being called and what your function code looks like? Does the same behavior occur from something like postman?

0 Votes 0 · ·

1 Answer

ajkuma-MSFT avatar image
ajkuma-MSFT answered ·

@MartinJrgensen-7072, Welcome to Microsoft Q&A! Thanks for the question.

Ack! Azure Function service is yet to be migrated to Q&A. Please post your question directly on the MSDN forum/continue your discussion there for the service (Azure Function forum)

We are actively working to onboard all services. We will make a public announcement once complete.
Checkout 'Microsoft Q&A Getting Started' to learn about the new platform.


Thank you for your patience as we evolve the Q&A platform.


Having mentioned above & as Jeremey suggested try to narrow-down the issue via Postman and review the code for the timeout configuration. I understand you have already tried, enabling Always on and FunctionTimeout option, durable Function orchestrations are implemented in code and can use the programming language's built-in error-handling features to isolate the issue further. You might want to abandon a function call within an orchestrator function if it's taking too long to complete. Typically, the proper way to do this today is by creating a durable timer ( using context.CreateTimer (.NET) or context.df.createTimer (JavaScript) in conjunction with Task.WhenAny (.NET) or context.df.Task.any (JavaScript).


For longer processing times, consider using the Durable Functions async pattern or defer the actual work and return an immediate response.


Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.