Skip to content

[Serve] Endpoints are not deleted correctly with multiple clients #12799

@architkulkarni

Description

@architkulkarni

There can be multiple Serve clients accessing the same Serve controller. However, each client has its own ServeHandle cache. Here's the relevant piece of client code:

    def delete_endpoint(self, endpoint: str) -> None:
        """Delete the given endpoint.

        Does not delete any associated backends.
        """
        if endpoint in self._handle_cache:
            del self._handle_cache[endpoint]
        ray.get(self._controller.delete_endpoint.remote(endpoint))

That means when an endpoint is deleted using one client, it remains in the cache of the other clients. This can cause issue using ServeHandles when endpoint names are reused after the endpoint is deleted. In particular, when running test_api.py, old endpoints named "endpoint" can persist across multiple tests when using multiple clients, even though delete_endpoint is called between each test, because "endpoint" is reused across many tests.

Metadata

Metadata

Labels

serveRay Serve Related Issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions