Function timing out after increase

Hello,

I recently had the timeout for our lambda-function increased to 26 seconds. However, I’m still seeing the function timeout intermittently. Looking at the log entry for today (below) I see two different ids/signatures at 1:37:59 (b20181144) and 1:38:22 (786e45a2). Does that indicate the previous request timed out and was retried twice? The function only sends two simple emails followed by an API call to log a small piece of data. Any idea what would be taking 26 seconds? Is it possibly due to the app and function running in different regions?

Site: https://be-web.netlify.app/
Function: send-form-emails.js

Here’s the most recent timeout from today (5/4/2021):

    1:37:59 AM b2018144 Duration: 26026.43 ms   Memory Usage: 80 MB   Init Duration: 181.47 ms
**1:37:59 AM b2018144 ERROR  Task timed out after 26.03 seconds**
1:38:22 AM 786e45a2 INFO   Splash Confirmation email sent to XXX@aol.com for 'XXX Smith VA'
1:38:24 AM 786e45a2 INFO   Splash Owner email sent to: XXX@bayeq.com for 'XXX Smith VA'
1:38:31 AM 786e45a2 INFO   Splash BAMM info: 200 Lead received. 
1:38:31 AM 786e45a2 Duration: 11185.01 ms	Memory Usage: 24 MB

1:39:01 AM edc35cb4 INFO   Splash Confirmation email sent to XXX@aol.com for 'XXX Smith VA'
1:39:03 AM edc35cb4 INFO   Splash Owner email sent to: XXX@bayeq.com for 'XXX Smith VA'
1:39:04 AM edc35cb4 INFO   Splash BAMM info: 200 Lead received. 
1:39:04 AM edc35cb4 Duration: 5326.93 ms	Memory Usage: 26 MB

Here are other dates/times where the similar timeouts have occurred, causing duplicate emails/API calls:

4/15/2021  6:13 PM
4/18/2021  7:38 PM
4/21/2021  1:01 PM
4/21/2021  5:52 PM
4/25/2021 12:55 AM

Any insight would be appreciated.

Thanks,
-Ken

Does anyone have any input/suggestions on this?

Thanks!

Hey there, @kyeck

Thanks for your patience here, and thanks for writing a detailed post! We haven’t forgotten about this thread.

Is this still happening this week? Please let us know. I have pinged it over to a Support Engineer to chime in on, as is a bit above the support that I can offer :slight_smile:

Hey! Looks like whatever the function is doing is just taking too long to respond. This is purely down to the code and the other services involved!

Depending on whether a response is needed, consider background functions.

Hi Hillary,

It has not happened recently. Strange.

Pie, I would think the same thing. The log entries indicate that the function completes successfully in ~6-10s. Barring any issue with the environment itself, the only way the function could exceed 26s is for the email or API server we’re calling to be down or inaccessible. But we may never know if that’s the case because the function gets timed out before those calls fail and get logged.

Could you implement some sort of try/catch after say 20 seconds to spawn the function again with the same params if you don’t get a healthy response from the third party?

1 Like