Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[serve][streaming] No replicas available blocks the HTTP proxy event loop #36460

Closed
edoakes opened this issue Jun 15, 2023 · 0 comments · Fixed by #36459
Closed

[serve][streaming] No replicas available blocks the HTTP proxy event loop #36460

edoakes opened this issue Jun 15, 2023 · 0 comments · Fixed by #36459
Assignees
Labels
bug Something that is supposed to be working; but isn't P1 Issue that should be fixed within a few weeks serve Ray Serve Related Issue

Comments

@edoakes
Copy link
Contributor

edoakes commented Jun 15, 2023

The loop waiting for a replica is not properly yielding. Repro:

# test.py
import asyncio

from ray import serve

@serve.deployment
class A:
    def __init__(self):
        print("SLEEPING")
        import time;time.sleep(10)
        print("DONE SLEEPING")

    def __call__(self, *args):
        return "hi"

a = A.bind()

In one terminal:

RAY_SERVE_ENABLE_EXPERIMENTAL_STREAMING=1 serve run test:a

In second terminal:

curl -v -X GET http:https://localhost:8000/
curl -v -X GET http:https://localhost:8000/-/routes

The /-/routes call hangs until the replica finishes initializing.

@edoakes edoakes added bug Something that is supposed to be working; but isn't P1 Issue that should be fixed within a few weeks serve Ray Serve Related Issue labels Jun 15, 2023
@edoakes edoakes self-assigned this Jun 15, 2023
edoakes added a commit that referenced this issue Jun 15, 2023
…ocking proxy event loop (#36459)

`replica_updated_event` was not being cleared. It seems that even though we were awaiting the event, it was not yielding the loop because the event was always set. This caused the `while replica is not None` loop to busy-spin, blocking the HTTP proxy event loop.

Closes #36460
arvind-chandra pushed a commit to lmco/ray that referenced this issue Aug 31, 2023
…ocking proxy event loop (ray-project#36459)

`replica_updated_event` was not being cleared. It seems that even though we were awaiting the event, it was not yielding the loop because the event was always set. This caused the `while replica is not None` loop to busy-spin, blocking the HTTP proxy event loop.

Closes ray-project#36460

Signed-off-by: e428265 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't P1 Issue that should be fixed within a few weeks serve Ray Serve Related Issue
Projects
None yet
1 participant