Skip to content

why can not cancel the request in the first model of ensemble_model #6739

@eeeeeunjung

Description

@eeeeeunjung

Description
i have a ensemble model, and two sub model with python backend,
i add code like this in my two sub model, the models are one instance,and max batch size is 1,

    def execute(self, requests=None):
        responses = []
        for request in requests:
            if request.is_cancelled():
                responses.append(
                    pb_utils.InferenceResponse(
                        error=pb_utils.TritonError("Request Cancelled", pb_utils.TritonError.CANCELLED)
                    )
                )
                continue

and i use python grpc to send three requests,when the first request is being handled and the others are waiting,i send cancellcation request,but all three requests call request.is_cancelled() return false in the first model,only return true in the second model,but i want to exit in the first model.
I'm not sure if this is a feature or a bug

client code like this:

        async_request = client.async_infer(
            model_name="ensemble_model",
            inputs=inputs,
            outputs=outputs,
            callback=partial(callback, user_data),
        )
        time.sleep(2)
        print("cancel")
        async_request.cancel()
        print("sleep")
        time.sleep(12)

Triton Information
triton 23.10 Ubuntu 22.04.3

Expected behavior
after i send cancellcation, the request call is_cancelled() return true in the first model of ensemble model

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmodule: serverIssues related to the server corequestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions