-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHORE] Refactor RayRunner so that we can add tracing (#3163)
This PR refactors the RayRunner so that it is easier to add tracing. I also added more docstrings to make it clearer about what is happening. ## Code Changes I highlight changes that were made in the code for easier review. 1. I removed the `next_step` state, and instead expose a new `has_next` return variable from `self._construct_dispatch_batch`. This cleans up the code because iteration on the physical plan now ONLY happens inside of `self._construct_dispatch_batch` instead of being scattered across the scheduling loop. 2. I cleaned up the logic in `self._await_tasks` by explicitly waiting on one task (with `timeout=None`) to first wait for any task to complete, and then perform an actual wait on all tasks (with `timeout=0.01`) to actually retrieve tasks that are ready. 3. I pulled out `self._is_active` and `self._place_in_queue` into methods, instead of them being locally-defined functions --------- Co-authored-by: Jay Chia <[email protected]@users.noreply.github.com>
- Loading branch information
Showing
1 changed file
with
204 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters