Aws SDk Go V2 Lambda, deadline is 1970-01-1 while local debugging

0

Hi,

I have simple lambda code:

func handleLambdaEvent(ctxOrg context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
	orgDL, _ := ctxOrg.Deadline()
	fmt.Println(orgDL)

when its deployed to aws and called ( from API Gateway ) I see in logs current timestamp + X seconds, but when I run this locally and use awslambdarpc to call it I see:

1970-01-01 00:00:00 +0000 UTC

which causes some problems in other parts of this lambda. Is it possible somehow, using awslambdarpc or maybe some config ( just for local ) to define this deadline value ?

Baku
posta un anno fa175 visualizzazioni
2 Risposte
0

I think it's very odd that the timestamp is the beginning of the Unix epoch. There's been a few other questions which I think are related given that the console in those cases also looks like it is set to January 1, 1970. Please contact our support team to check on the status of the account.

profile pictureAWS
ESPERTO
con risposta un anno fa
0

ok looks like original awslambdarpc client is simply missing Deadline value set, so I prepared this default deadline to now()+15 seconds in my fork:

https://github.com/goodsafe-eu/awslambdarpc/commit/b6181a1acc581c12945c7361a3a3e4d5ad5f59c4 and now works fine

Baku
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande