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_client = aws_stack.connect_to_service("lambda")
        lambda_client.create_function(
            FunctionName="localstack-internal-awssdk",
            Runtime=LAMBDA_RUNTIME_NODEJS14X,
            Handler="index.handler",
            Code={"ZipFile": code},
            Role=LAMBDA_TEST_ROLE.format(account_id=get_aws_account_id()),
        )
        not_found = None
    if not_found:
        try:
            forward_result = forward_to_fallback_url(arn, json.dumps(data))
            if forward_result is not None:
                return _create_response(forward_result)
        except Exception as e:
            LOG.debug('Unable to forward Lambda invocation to fallback URL: "%s" - %s', data, e)
        return not_found
    if invocation_type == "RequestResponse":
        context = {"client_context": request.headers.get("X-Amz-Client-Context")}
        time_before = time.perf_counter()
        result = run_lambda(
            func_arn=arn,
            event=data,
            context=context,
            asynchronous=False,
            version=qualifier,
        )
        LOG.debug("Lambda invocation duration: %0.2fms", (time.perf_counter() - time_before) * 1000)
        return _create_response(result)