aws-lambda-dotnet: await Task does not work as expected
Hello AWS,
I am working with async calls using in lambda handler. However, the program does not work as expected. Error: "errorMessage": "RequestId: 991fc1fc-1558-11e7-bd03-3bb3c9d9b1b0 Process exited before completing request"
So I did some logging, it seems that the program ran the first line of code, but stopped when running the second one. Is there anything wrong with the way I am writing the async call?
Thanks!
public async Task FunctionHandler()
{
var sqsClient = new AmazonSQSClient();
var sqsResponse = await sqsClient.ReceiveMessageAsync(QueueUrl);
foreach (var message in sqsResponse.Messages)
{
// do something
}
}
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 21 (11 by maintainers)
We’re looking into this, but I’m not sure when this functionality will be available.
Thanks for the repo. The underlying issue here is that both jose-jwt 2.2 and System.Data.Common 4.3 target .NET Core 1.1, while Lambda currently only supports .NET Core 1.0. I was able to get the repo working by downgrading dependencies to jose-jwl 2.1 and System.Data.Common 4.1.
Immediately after a Lambda function is updated, a function invocation will take longer due to cold-start, where Lambda first needs to setup the container containing your function. This is expected.