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_cwd = lambda_function.cwd
    if code_passed:
        lambda_cwd = lambda_cwd or set_archive_code(code_passed, lambda_function.name())
        if not zip_file_content and not is_local_mount:
            
            zip_file_content = get_zip_bytes(code_passed)
    else:
        lambda_details = LambdaRegion.get().lambdas[lambda_function.arn()]
        lambda_cwd = lambda_cwd or lambda_details.cwd
    if not lambda_cwd:
        return
    
    archive_file = os.path.join(lambda_cwd, LAMBDA_ZIP_FILE_NAME)
    if not zip_file_content:
        zip_file_content = load_file(archive_file, mode="rb")
    else:
        
        save_file(archive_file, zip_file_content)
    return lambda_cwd, archive_file, zip_file_content
def do_set_function_code(lambda_function: LambdaFunction):
    """Main function that creates the local zip archive for the given Lambda function, and
    optionally creates the handler function references (for LAMBDA_EXECUTOR=local)"""
    def generic_handler(*_):
        raise ClientError(
            (
                'Unable to find executor for Lambda function "%s". Note that '
                + "Node.js, Golang, and .Net Core Lambdas currently require LAMBDA_EXECUTOR=docker"
            )
            % lambda_name
        )