-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NodeJS SDK lambda client does not throw when reaching socketTimeout or Agent.timeout / NAT timeout #3710
Comments
@kuhe is there any update on this issue? I'm seeing a similar issue with calls out to S3. I've set the socketTimeout value to 3s but I see my calls taking more than 6s and succeeding. This makes me think the socketTimeout value is not actually working |
No update, there is not enough information or priority available to work on this. It may be due to something specific to Lambda. |
@kuhe This is effecting us in production and a ticket raised months ago with AWS Support who pointed us towards this issue, maybe due to the combination of NAT Gateway and Lambda? |
@kizaonline @ronak2121 and all others impacted by this bug - there's a simple hack you can use to avoid this issue: complete a guaranteed fast request with the client, before attempting the >5 minute request. e.g. if there's a lambda invoke that may take >5 minutes, first use the client to make an invoke request with the DryRun parameter set to true, then attempt the >5 minute invoke.
this works because the keepalive parameters are not applied until after the first request is completed. you can see it in this code - state.keepAliveTimeoutSet = true; I highly recommend adding this workaround to your code - bnoordhuis mentions that this is intended behavior in node, so there's no guarantee it will ever be fixed:
|
Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Describe the bug
Discovered while testing #3624
When the SDK Client should time out upon breaching the node http Agent timeout setting or the
NodeHttpHandler
socketTimeout setting, instead nothing happens and the promise continues to be awaited.Expected Behavior
When breaching the Agent's timeout value or the NodeHttpHandler's socketTimeout value, I would expect the SDK client to throw a timeout error to be handled by the client's caller.
Current Behavior
It may be restricted to this Lambda NAT timeout case, but the request from
client.send(...)
continues to be awaited.Reproduction Steps
AWS resource stack:
Code for calling B from Invoker (modify function names as needed):
Possible Solution
Race promise to throw timeout?
Additional Information/Context
This is not a solution for the timeout failing to throw, but incidental workaround to the timeout issue.
Making an SDK client request to a shorter lambda (or perhaps making any client request at all) first before calling the long-running lambda makes it succeed despite taking longer time overall.
Succeeds (!?)
SDK version used
3.110.0
Environment details (OS name and version, etc.)
AWS AL2
The text was updated successfully, but these errors were encountered: