While a lambda is still processing (archive unpacking etc), the lambda state should be set to "Pending" (currently "Active") and invocations to that lambda should fail (currently, it can end up in a inconsistent state in this case, like lambdas being executed without layers).

Lambda state should reflect the current internal state, and invocations should fail if not active.
lambda_name = lambda_function.name()
    arn = lambda_function.arn()
    runtime = get_lambda_runtime(lambda_function)
    lambda_environment = lambda_function.envvars
    handler_name = lambda_function.handler = lambda_function.handler or LAMBDA_DEFAULT_HANDLER
    code_passed = lambda_function.code
    is_local_mount = code_passed.get("S3Bucket") == config.BUCKET_MARKER_LOCAL
    
    LAMBDA_EXECUTOR.cleanup(arn)
    
    _result = store_and_get_lambda_code_archive(lambda_function)
    if not _result:
        return
    lambda_cwd, archive_file, zip_file_content = _result
    
    lambda_handler = generic_handler
    is_java = lambda_executors.is_java_lambda(runtime)
    if is_java:
        
        
        
        try:
            lambda_handler = get_java_handler(
                zip_file_content, archive_file, lambda_function=lambda_function
            )
        except Exception as e:
            
            LOG.debug("Unable to determine Lambda Java handler: %s", e)
    if not is_local_mount: