-
Notifications
You must be signed in to change notification settings - Fork 18
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
Killing and reusing Julia consoles #1586
Comments
Thank you for this! |
Similar issue: spine-tools/spine-engine#20 There is also the related issue of controlling the parallelization better. Max. number, and even more refined control, has been discussed before, but it seems we need a proper issue for it. |
Indeed, and this can be disscussed under spine-tools/spine-engine#35 |
It is now possible to limit the number of persistent processes that run simultaneously. The useful 'lifetime' of a persistent process is between the instantiation of PersistentExecutionManager and the end of PersistentExecutionManagerBase.run_until_complete(). After that the process may be killed by Engine if the process limit has been reached. We use semaphores to keep count on running persistent processes. This commit also replaces the hand-written semaphore implementation for ReturningProcess by Python's standard Semaphore class. Re #35, spine-tools/Spine-Toolbox#1586
Engine may now kill the processes that run Python/Julia interpreters for persistent consoles. This commit makes PersistentConsoleWidget issue a warning in this case instead of getting stuck if user tries to use a dead console. Also, this adds widgets to control engine's maximum number of persistent processes to Toolbox settings. Re #1586, spine-tools/spine-engine#35
It is now possible to control the number of console processes. The setting can be found in Toolbox settings under the Engine tab. Spine Engine will start killing random console processes that have finished execution when the limit is reached. This means that you'll still get the execution output in the console window but post-execution debugging is impossible as the Python/Julia interpreter connected to the window is dead. |
Nice job! But I think it would also be useful to create a context menu action to just kill a console. I think this issue is more about that, killing specific consoles that hog a lot of memory. |
Indeed. I wasn't planning on closing this issue yet. On that note, it is currently possible to free most of the console's memory by restarting it as stated in the Description. This makes me wonder how useful a close option actually is. It is not difficult to implement, though, as I had it implemented for a few hours last week ;) I had to take it down, however, as it was interfering with something else I was working at that moment. |
You're right. I think it's mostly for users' piece of mind, and it's so easy to implement that why not? |
Added an action to the console context menu that kills the console process. A killed console refuses to take any input but can be restored by restarting. Re #1586
Tool project item now has an option that, when set, kills persistent console processes after execution is finished. Re spine-tools/Spine-Toolbox#1586
Added an action to the console context menu that kills the console process. A killed console refuses to take any input but can be restored by restarting. Re #1586
Added an action to the console context menu that kills the console process. A killed console refuses to take any input but can be restored by restarting. Re #1586
Tool project item now has an option that, when set, kills persistent console processes after execution is finished. Re spine-tools/Spine-Toolbox#1586
Tool project item now has an option that, when set, kills persistent console processes after execution is finished. Re spine-tools/Spine-Toolbox#1586
Added an action to the console context menu that kills the console process. A killed console refuses to take any input but can be restored by restarting. Re #1586
Added an action to the console context menu that kills the console process. A killed console refuses to take any input but can be restored by restarting. Re #1586
Tool project item now has an option that, when set, kills persistent console processes after execution is finished. Re spine-tools/Spine-Toolbox#1586
Now we have:
Reusing the console processes has already been possible by setting the "Group id" in Tool properties tab. I believe we are done here. |
When I run a workflow with multiple SpineOpt scenarios executed in parallel, when each execution completes, each console remains open and holding a lot of stuff in memory. In my case, around 6GB per console. There are a number of issues here:
The text was updated successfully, but these errors were encountered: