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.
)
        
        if runtime.startswith("python") and not use_docker():
            try:
                
                ensure_readable(main_file)
                zip_file_content = load_file(main_file, mode="rb")
                
                handler_function = get_handler_function_from_name(handler_name, runtime=runtime)
                lambda_handler = exec_lambda_code(
                    zip_file_content,
                    handler_function=handler_function,
                    lambda_cwd=lambda_cwd,
                    lambda_env=lambda_environment,
                )
            except Exception as e:
                raise ClientError("Unable to get handler function from lambda code: %s" % e)
        if runtime.startswith("node") and not use_docker():
            ensure_readable(main_file)
            def execute(event, context):
                result = lambda_executors.EXECUTOR_LOCAL.execute_javascript_lambda(
                    event, context, main_file=main_file, lambda_function=lambda_function
                )
                return result
            lambda_handler = execute
        if runtime.startswith("go1") and not use_docker():
            install_go_lambda_runtime()
            ensure_readable(main_file)
            def execute_go(event, context):
                result = lambda_executors.EXECUTOR_LOCAL.execute_go_lambda(