- Newest
- Most votes
- Most comments
Hi,
A common cause of EBUSY getaddrinfo is running out of file descriptors. This may come from underlying the kernel shared by all the Lambda containers.
So, yes, not much that you can do!
Unless your Lambda opens lots of files or tcp sockets in parallel.... which is probably not the case. You may reach such a case with tcp sockets if your Lambda has high throughput with lots of parallel executions of it on same server: reducing tcp sessions to a very minimum may solve your issue because it will free descriptors.
Best,
Didier
I don't have a specific answer, but I hope this will be helpful.
https://repost.aws/knowledge-center/lambda-intermittent-consistent-dns-error
HI
I noticed your Lambda client is instantiated inside the handler const lambda = new LambdaClient();
Is it possible to move this outside the handler and see if it improves the situtation?
import { LambdaClient, InvokeCommand } from "@aws-sdk/client-lambda";
const lambda = new LambdaClient(); //outside handler
export const handler = async (event) => {
try {
var params = {
FunctionName: '<anotherfunction>', // the lambda function we are going to invoke
Payload: JSON.stringify(event)
};
const command = new InvokeCommand(params);
let ret = await lambda.send(command);
if (ret && ctx.Payload) {
let payload = JSON.parse(Buffer.from(ret.Payload));
if (payload.statusCode == 200) {
return payload;
}
}
} catch (e) {
console.error(e);
}
...
Relevant content
- asked 3 months ago
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
So what are our options? Ditch AWS Lambda? This causes severe downgrade in our production environment.