Found in version 0.1.0 of the rules.
The following case is not caught by the rules today:
Handler Impl:
public class ChildHandler extends ParentHandler implements RequestHandler<APIGatewayProxyRequestEvent, Object> {
public Object handleRequest(APIGatewayProxyRequestEvent event, Context context) {
LambdaLogger logger = context.getLogger();
logger.log(id.toString());
return null; // TODO: Implement Me
}
}
Parent Class:
public abstract class ParentHandler {
protected final UUID id = UUID.randomUUID();
protected ParentHandler() {}
}
However if the random id is created in the lambda class itself I do get an error:
public class Handler implements RequestHandler<APIGatewayProxyRequestEvent, Object> {
protected final UUID id = UUID.randomUUID();
public Object handleRequest(APIGatewayProxyRequestEvent event, Context context) {
LambdaLogger logger = context.getLogger();
logger.log(id.toString());
return null; // TODO: Implement Me
}
}
Error:
[INFO] BugInstance size is 1
[INFO] Error size is 0
[INFO] Total bugs: 1
[ERROR] High: Detected handler state that is potentially not resilient to VM snapshot and restore operations in Lambda function com.alianza.api.auth.lambda.Handler. [com.alianza.api.auth.lambda.Handler] At Handler.java:[line 14] AWS_LAMBDA_SNAP_START_BUG
My understanding of CRaC and Snapstart is that both these cases are the same and should be caught by these rules.
Found in version
0.1.0of the rules.The following case is not caught by the rules today:
Handler Impl:
Parent Class:
However if the random id is created in the lambda class itself I do get an error:
Error:
My understanding of CRaC and Snapstart is that both these cases are the same and should be caught by these rules.