Lambda Netcore 3.1 why cloudsearchdomain search hang when it is deployed?


i have a lambda net core 3.1 +apigateway that must launch a search on a cloudsearchdomain.
i use this code :

using (var client = new AmazonCloudSearchDomainClient(searchServiceConfig))
LambdaLogger.Log("launch search");
Task<SearchResponse> task = client.SearchAsync(request);
 task.Wait();                                        //// hang here
 LambdaLogger.Log("parse result");/// this message don&#39;t appear in the cloudwatch log
SearchResponse response = task.Result;
LambdaLogger.Log("after parse result");
totalResult = response.Hits.Found;

when i test this code :
in a windows app : OK
with Mock Lambda Test Tools : OK
deployed in lambda on aws infrastruture : KO the code don't pass the task.Wait() instruction.
any idea for unblock this problem ?

feita há 4 anos191 visualizações
1 Resposta

it was not a problem with async method. it was a problem with vpc

respondido há 4 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas