我正在使用链接多个Lambda函数的步骤函数。其中一个Lambda函数中我调用了另一个Lambda函数。这两个Lambda函数都设置了15分钟的超时时间。但是,在一些时间后,调用次级Lambda函数的主要Lambda函数超时了(而次级Lambda函数仍然愉快地继续工作)。
Error
com.amazonaws.SdkClientException
Cause
{"errorMessage": "Unable to execute HTTP request: Read timed out",
"errorType": "com.amazonaws.SdkClientException",
"stackTrace": [
cause": {
"errorMessage": "Read timed out",
"errorType": "java.net.SocketTimeoutException",
"stackTrace": [
"java.net.SocketInputStream.socketRead0(Native Method)",
"java.net.SocketInputStream.socketRead(SocketInputStream.java:116)",
"java.net.SocketInputStream.read(SocketInputStream.java:171)",
"java.net.SocketInputStream.read(SocketInputStream.java:141)",
"sun.security.ssl.InputRecord.readFully(InputRecord.java:465)",
"sun.security.ssl.InputRecord.read(InputRecord.java:503)",
"sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)",
"sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)",
"sun.security.ssl.AppInputStream.read(AppInputStream.java:105)",
这是代码,你可以看到我尝试使用4个不同的命令来提高超时时间。
// (2) Instantiate AWSLambdaClientBuilder to build the Lambda client
AWSLambdaClientBuilder builder =
AWSLambdaClientBuilder.standard().withRegion(region);
// (3) Build the client, which will ultimately invoke
the function
AWSLambda client = builder.build();
// (4) Create an InvokeRequest with required parameters
InvokeRequest req = new
InvokeRequest().withFunctionName(random_arn).withPayload(jsonString);
// (5) Invoke the function and capture response
int timeout = (15*60*1000);
req.setSdkClientExecutionTimeout(timeout);
req.setSdkRequestTimeout(timeout);
req.withSdkClientExecutionTimeout(timeout);
req.withSdkRequestTimeout(timeout);
InvokeResult result = client.invoke(req);
有什么办法解决这个超时问题吗?