I have 2 lambda functions inside AWS.
Function A (FA), attempts to synchronously call Function B (FB). When FA attempts to call FB, FA will timeout. FA never reaches the callback method inside in FA and FB has no logs in cloudwatch to say it was called.
I have set up both functions to operate within the same region, same role, and no VPC (as I've read the VPC can cause issues, but have tried under the same VPC and subnet settings as well with no luck)
The user role has the following permissions associated
- AWSLambdaExecute
- AWSLambdaBasicExecutionRole
- AWSLambdaRole
Funciton A
exports.handler = (event, context, callback) => {
var aws = require('aws-sdk');
var lambda = new aws.Lambda({
region: 'ap-southeast-2'
});
lambda.invoke({
FunctionName: 'async-receiver-test'
}, function(error, data) {
console.log('inside return function');
if (error) {
context.done('error', error);
}
if(data.Payload){
context.succeed(data.Payload);
}
});
};
Function B - (name => async-receiver-test)
exports.handler = (event, context, callback) => {
var eventItem = {id : 53148, name : "Let's get testing"};
callback(null, eventItem);
};
Running Function A inside the console returns
REPORT RequestId: 2db82333-f9c3-11e6-8160-93bd7ddf5b19 Duration: 3000.43 ms Billed Duration: 3000 ms Memory Size: 128 MB Max Memory Used: 25 MB
2017-02-23T12:25:39.363Z 2db82333-f9c3-11e6-8160-93bd7ddf5b19 Task timed out after 3.00 seconds
Running Function B inside the console (Duration: 14.36 ms)
{ "id": 53148, "name": "Let's get testing" }
So it's not an issue with FB from what i can tell, but for some reason there is no response when invoked from FA.