-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] Enable buffered iteration on plans (#2566)
Helps close part of #2561 This PR enables buffering of result partition tasks, preventing "runaway execution" of executions when run concurrently. The problem previously was that if we ran two executions in parallel (`e1` and `e2`) on a machine with 8 CPUs: 1. `e1` could potentially run `8` tasks and keep them buffered (not releasing the resource request) 2. When `e2` attempts to run the next task, it notices that the task cannot be admitted on the system (due to memory constraints) * `e2` thinks that it is deadlocking because there is a strong assumption in the pyrunner today that if a task cannot be admitted, it merely has to wait for some other tasks in the same execution to finish up. * However, `e2` doesn't have any tasks currently pending (because it is starved). The pending tasks are all buffered in `e1`. Thus it thinks that it is deadlocking. ## Solution * This PR sets the default buffering behavior to `1` instead of allowing each execution to run as many tasks as it wants * We introduce logic in the physical plan to have an upper limit on the size of the materialization buffer. If that buffer gets too large, it will start yielding `None` to indicate that the plan is unable to proceed. Note that there is still potentially a problem here, e.g. running > NUM_CPU number of executions concurrently. That can be solved in a follow-up PR for refactoring the way we do resource accounting. --------- Co-authored-by: Jay Chia <[email protected]@users.noreply.github.com> Co-authored-by: Desmond Cheong <[email protected]>
- Loading branch information
1 parent
8fce5b5
commit 4fec71c
Showing
7 changed files
with
309 additions
and
37 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
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
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
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
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
Empty file.
Oops, something went wrong.