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.
from localstack.utils.analytics import event_publisher
from localstack.utils.aws import aws_stack
from localstack.utils.aws.aws_models import CodeSigningConfig, LambdaFunction
from localstack.utils.aws.aws_responses import ResourceNotFoundException
from localstack.utils.common import (
    TMP_FILES,
    empty_context_manager,
    ensure_readable,
    first_char_to_lower,
    get_unzipped_size,
    is_zip_file,
    isoformat_milliseconds,
    json_safe,
    load_file,
    long_uid,
    mkdir,
    now_utc,
    parse_request_data,
    run,
    run_for_max_seconds,
    safe_requests,
    save_file,
    short_uid,
    synchronized,
    timestamp_millis,
    to_bytes,
    to_str,
    unzip,
)
from localstack.utils.container_networking import get_main_container_name