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.
try:
        resource_path = resource_path or path
        event = construct_invocation_event(
            method, path, headers, payload, query_string_params, is_base64_encoded
        )
        path_params = dict(path_params)
        fix_proxy_path_params(path_params)
        event["pathParameters"] = path_params
        event["resource"] = resource_path
        event["requestContext"] = request_context
        event["stageVariables"] = stage_variables
        LOG.debug(
            "Running Lambda function %s from API Gateway invocation: %s %s",
            func_arn,
            method or "GET",
            path,
        )
        asynchronous = headers.get("X-Amz-Invocation-Type") == "'Event'"
        inv_result = run_lambda(
            func_arn=func_arn,
            event=event,
            context=request_context,
            asynchronous=asynchronous,
        )
        return inv_result.result
    except Exception as e:
        LOG.warning(
            "Unable to run Lambda function on API Gateway message: %s %s", e, traceback.format_exc()
        )
def construct_invocation_event(