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.
event, context, main_file=main_file, lambda_function=lambda_function
                )
                return result
            lambda_handler = execute_go
    if lambda_handler:
        lambda_executors.LambdaExecutorLocal.add_function_callable(lambda_function, lambda_handler)
    return lambda_handler
def do_list_functions():
    funcs = []
    region = LambdaRegion.get()
    this_region = aws_stack.get_region()
    for f_arn, func in region.lambdas.items():
        if type(func) != LambdaFunction:
            continue
        
        func_region = f_arn.split(":")[3]
        if func_region != this_region:
            continue
        func_name = f_arn.split(":function:")[-1]
        arn = func_arn(func_name)
        lambda_function = region.lambdas.get(arn)
        if not lambda_function:
            
            continue
        details = format_func_details(lambda_function)
        details["Tags"] = func.tags
        funcs.append(details)
    return funcs
def format_func_details(
    lambda_function: LambdaFunction, version: str = None, always_add_version=False