-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[runtime env] Make plugin setup process that has not been refactor run in threads. #22588
Conversation
|
||
|
||
def test_plugin_hang(ray_start_regular): | ||
@ray.remote(num_cpus=0.1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before this PR, this case will be failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for adding this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I think this fix is very important for stability.
Thanks @Catch-Bull. Could you please also leave a comment for why we're doing this and a TODO to remove it once refactored? |
We only make the The problem is that running sync logic in an async method blocks the asyncio loop. This PR makes the setup process (sync logic) in threads before they are fully async. |
# Currently create method is still a sync process, to avoid blocking | ||
# the loop, need to run this function in another thread. | ||
# TODO(Catch-Bull): Refactor method create into an async process, and | ||
# make this method running in current loop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Catch-Bull. Could you please also leave a comment for why we're doing this and a TODO to remove it once refactored?
@edoakes I add annotations and TODO, and copy those to conda.py, py_modules.py, and working_dir.py
|
According to https://flaky-tests.ray.io/ |
It will raise Import error, I have no idea why this happens on windows but, I found that after I did not call RuntimeEnvPlugin in remote_function, the test basically passed every time, change in here: 37698a6 |
I recently realized that during a runtime_env creation process, a plugin/manager that is very slow to setup may block the creation of other runtime_env, so I make plugin/manager setup run in threads.
The refactor of
PipManager
is about to be completed, so I ignore it in this PR.Related issue number
Checks
scripts/format.sh
to lint the changes in this PR.