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][python3.11] Use tasks/futures for asyncio.wait #31608

Merged
merged 4 commits into from
Jan 24, 2023

Conversation

zcin
Copy link
Contributor

@zcin zcin commented Jan 11, 2023

Signed-off-by: Cindy Zhang [email protected]

Why are these changes needed?

In Python 3.11, coroutines are no longer allowed in asyncio.wait. Need to pass in a task instead.

Related issue number

#31360

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Cindy Zhang <[email protected]>
@zcin zcin changed the title [serve][python3.11] Use tasks for asyncio.wait [serve][python3.11] Use tasks/futures for asyncio.wait Jan 11, 2023
Signed-off-by: Cindy Zhang <[email protected]>
Signed-off-by: Cindy Zhang <[email protected]>
@zcin zcin marked this pull request as ready for review January 13, 2023 18:28
Copy link
Contributor

@edoakes edoakes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any behavior difference here?

@zcin
Copy link
Contributor Author

zcin commented Jan 13, 2023

Is there any behavior difference here?

I don't think so. According to the docs:
"If any awaitable in aws is a coroutine, it is automatically scheduled as a Task."

So from my understanding, instead of the coroutine setup_complete.wait() being scheduled for us, we are just manually scheduling it as a task before passing it to asyncio.wait.

@edoakes edoakes merged commit 8c88bdc into ray-project:master Jan 24, 2023
@zcin zcin deleted the py11-serve-fix branch January 27, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants