函数完成后Lambda API超时

时间:2018-12-14 10:30:52

标签: amazon-web-services aws-lambda

我们有一个使用JS API调用的lambda函数。该功能正常完成,我们在日志中看到了Lambda报告。

END RequestId: c78a238e-fefd-11e8-935a-2526b5b5f5c1 
REPORT RequestId: c78a238e-fefd-11e8-935a-2526b5b5f5c1  Duration: 465968.78 ms   
Billed Duration: 466000 ms  Memory Size: 3008 MB    Max Memory Used: 290 MB

奇怪的是,API调用返回“未处理”错误。

   const params = {
       FunctionName: process.env.WORKER_LAMBDA,
       InvocationType: 'RequestResponse',
       Payload: {}
   };

    this.lambda.invoke(params).promise()
        .then(result => this._handleResult(launchParams, result))
        .catch(error => this._handleResult(launchParams, error));

结果处理程序函数记录以下内容:

Lambda result: { TimeoutError: Connection timed out after 990000.0000000001ms 
     at ClientRequest.<anonymous> (/opt/timeline/backend/node_modules/aws-sdk/lib/http/node.js:83:34) 
     at Object.onceWrapper (events.js:313:30) 
     at emitNone (events.js:106:13) 
     at ClientRequest.emit (events.js:208:7) 
     at TLSSocket.emitTimeout (_http_client.js:706:34) 
     at Object.onceWrapper (events.js:313:30) 
     at emitNone (events.js:106:13) 
     at TLSSocket.emit (events.js:208:7) 
     at TLSSocket.Socket._onTimeout (net.js:410:8) 
     at ontimeout (timers.js:498:11) 
     at tryOnTimeout (timers.js:323:5) 
     at Timer.listOnTimeout (timers.js:290:5) 
   message: 'Connection timed out after 990000.0000000001ms', 
   code: 'TimeoutError', 
   time: 2018-12-13T17:54:06.269Z, 
   region: 'us-east-1', 
   hostname: 'lambda.us-east-1.amazonaws.com', 
   retryable: true } 

当函数成功完成并且AWS lambda知道该函数时,API会返回错误吗?

谢谢您的帮助!

Tamas

0 个答案:

没有答案