-
Notifications
You must be signed in to change notification settings - Fork 3
Explicitly track and wait for futures #710
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
Conversation
To guarantee the fulfillment of the executor contract: shutdown will not complete while waiting for futures to finish. Signed-off-by: liamhuber <[email protected]>
Signed-off-by: liamhuber <[email protected]>
WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TaskSchedulerBase
User->>TaskSchedulerBase: submit(fn, *args, **kwargs)
TaskSchedulerBase->>TaskSchedulerBase: Create Future
TaskSchedulerBase->>TaskSchedulerBase: Add Future to _futures
TaskSchedulerBase->>TaskSchedulerBase: Enqueue task
User->>TaskSchedulerBase: shutdown(wait, cancel_futures)
alt cancel_futures == True
TaskSchedulerBase->>TaskSchedulerBase: Cancel all futures in _futures
end
alt wait == True
TaskSchedulerBase->>TaskSchedulerBase: Wait for all futures in _futures
end
TaskSchedulerBase->>TaskSchedulerBase: Clear _futures
Assessment against linked issues
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (5)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #710 +/- ##
==========================================
- Coverage 96.89% 96.76% -0.13%
==========================================
Files 29 29
Lines 1320 1329 +9
==========================================
+ Hits 1279 1286 +7
- Misses 41 43 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jan-janssen
left a comment
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.
The queue.join() can only be executed when the execution of the future finished. So I would like to fix this issue in the file based executor rather than the Base executor, especially as you report it works fine for the SingleNodeExecutor:
There is something I'm not understanding deeply enough though, because it works fine for the SingleNodeExecutor even when it's using the filesystem cache.
Then I suppose somehow we are triggering an
I have two objections to fixing it outside of The second is that I don't know how 😂 so go for it, but I'm afraid we'll have to close this and try elsewhere. |
To guarantee the fulfillment of the executor contract: shutdown will not complete while waiting for futures to finish.
This closes #709, but I'm not confident it's the right or best solution.
The tests passed locally, but we'll see how it goes here. It would be good to test this, too, maybe in
test_cache_fileexecutor_serial.py, but I'm not yet familiar with direct instantiation of the scheduler classes and the test class from #709 isn't in the code base yet.Summary by CodeRabbit
New Features
Bug Fixes