Skip to content

Commit

Permalink
[serve][python3.11] Use tasks/futures for asyncio.wait (#31608)
Browse files Browse the repository at this point in the history
In Python 3.11, coroutines are no longer allowed in `asyncio.wait`. Need to pass in a task instead.
  • Loading branch information
zcin authored Jan 24, 2023
1 parent 51f2d93 commit 8c88bdc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/ray/serve/_private/http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,12 @@ async def ready(self):
"""Returns when HTTP proxy is ready to serve traffic.
Or throw exception when it is not able to serve traffic.
"""
setup_task = get_or_create_event_loop().create_task(self.setup_complete.wait())
done_set, _ = await asyncio.wait(
[
# Either the HTTP setup has completed.
# The event is set inside self.run.
self.setup_complete.wait(),
setup_task,
# Or self.run errored.
self.running_task,
],
Expand Down

0 comments on commit 8c88bdc

Please sign in to comment.