I wanted to run some tasks which took more than 300 seconds. I enabled Fluid compute for this. Now when I am executing these tasks I am getting the below error. I am basically running crons using Inngest (https://www.inngest.com/). Can someone suggest what might be wrong here? Another thing that I observed here is that error occurs after 5 min 40 sec.
Error: http_unreachable: Error performing request to SDK URL: Your server reset the connection while we were reading the reply: Unexpected ending response
From what I can see in your logs your function times out after 800s (which is the maximum available on Fluid compute).
Can you share more about your workload?
No I haven’t been able to fix this yet. I had raised it to the vercel team and below was the reply that I got. I am still in discussion with them around this.
The function times out after 340 seconds and not 800 seconds. My current workload is I need to process a bulk job which can take around 2-3 hours to be completed. In order to process it through my nextJS API’s I divided this workflow in chunks where each chunk can take around 2-10 minutes.
Below is the reply from Vercel team. They need some more data from my end to verify this.
The critical distinction here is that the timeout you are experiencing is happening on the response side of the connection. While packets from Inngest to Vercel keep the initial request alive, the connection is considered idle if your Vercel Function does not send any data back to Inngest. Our infrastructure provider terminates any connection that does not send or receive data for more than 340 seconds (5.7 minutes). If your function is processing a task and does not begin to stream a response back to Inngest within that timeframe, the connection is flagged as idle and closed. This aligns perfectly with the failure timing you’ve observed. The key is that the response stream from your Vercel Function must remain active.
Anybody figure this out? Seems like a common use case - e.g if you’re waiting for an LLM to return a response and it takes longer than 5:40? Maybe Vercel could chime in on a simple way to keep the connection open while waiting a response. Would be great if it just respected the max duration.