Make the scheduler interface asynchronous - #7462
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v3 #7462 +/- ##
===========================================
- Coverage 80.39% 29.99% -50.39%
===========================================
Files 578 578
Lines 46128 46129 +1
===========================================
- Hits 37081 13833 -23248
- Misses 9047 32296 +23249 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
agoscinski
left a comment
There was a problem hiding this comment.
Looks reasonable. Can you update the Changelog with a section Breaking, and note there all the public API changes you do in this PR? Does not need to be anything complicated. A list like this def kill_job -> async def kill_job_async would be enough for now. Later we can put this properly in a json and use this to upgrade automatically plugins, and error out in case people use these functions. For the Scheduler its properly less useful, but lets stay consistent with all PRs.
|
|
||
|
|
||
| Checking the queued jobs on a scheduler | ||
| ======================================= |
|
|
||
| from aiida.manage import get_manager | ||
|
|
||
| loop = get_manager().get_runner().loop |
There was a problem hiding this comment.
Hm.. runner spins up a lot of things we do not need for just accessing the scheduler information. I would try to use only the runner if we want to run aiida processes. I am tending to just use get_event_loop so this private function does not spin up an event loop, in python 3.14 we get here then a RuntimeError if misused. The responsibility of starting the event loop lies in the command. For that we create a @with_event_loop decorator like @with_dbenv. I think this way we can also properly close the event loop.
Once v3 releases and if this merges, we should spawn agents to open PRs/issues on all external scheduler plugins giving them upgrade instructions.
These changes are backward incompatible.