Skip to content

Commit 6afface

Browse files
Refactor to deduplicate common code with route_and_send_request
Signed-off-by: Jeffrey Wang <jeffreywang@anyscale.com>
1 parent e8e49f7 commit 6afface

2 files changed

Lines changed: 155 additions & 153 deletions

File tree

python/ray/serve/_private/request_router/replica_wrapper.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,11 @@ class ReplicaSelection:
408408
default=False, init=False
409409
) # Tracks if dispatch was called
410410

411+
# Set by dispatch once the result's done-callback is wired up. Read by
412+
# choose_replica's finally to decide whether to fire on_request_completed
413+
# manually (only one of the two paths should fire it).
414+
_completion_callback_registered: bool = field(default=False, init=False)
415+
411416
@property
412417
def address(self) -> str:
413418
"""Returns the replica address in host:port format."""

0 commit comments

Comments
 (0)