Skip to content

Does not find bugs in Parent Abstract Classes #18

@JKomoroski

Description

@JKomoroski

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions