trailing sage-ipython processes in patchbots

28 views
Skip to first unread message

Thierry

unread,
Jul 17, 2022, 12:08:13 PM7/17/22
to sage-...@googlegroups.com
Hi,

while running a patchbot client, i see a lot of unfinished processes
whose command is "python3 /home/sagemath/sage/src/bin/sage-ipython -i"
at various dates, indicating that something is not killed properly. The
phenomenon is not new. Any hint on how to fix that ?

Ciao,
Thierry

Dima Pasechnik

unread,
Jul 17, 2022, 12:42:49 PM7/17/22
to sage-devel
this might have gotten broken in https://trac.sagemath.org/ticket/8784

Namely, in this chunk:

--- a/src/sage/repl/ipython_extension.py
+++ b/src/sage/repl/ipython_extension.py
@@ -434,7 +434,6 @@ class SageCustomizations(object):
import sage.all # until sage's import hell is fixed
self.shell.verbose_quit = True
- self.set_quit_hook()
self.register_interface_magics()
@@ -448,16 +447,6 @@ class SageCustomizations(object):
from sage.repl.interface_magic import InterfaceMagic
InterfaceMagic.register_all(self.shell)
- def set_quit_hook(self):
- """
- Set the exit hook to cleanly exit Sage.
- """
- def quit():
- import sage.all
- sage.all.quit_sage(self.shell.verbose_quit)
- import atexit
- atexit.register(quit)
-
@staticmethod
def all_globals():
"""


Maybe the author could say more.

Dima

Michael Orlitzky

unread,
Jul 20, 2022, 8:48:07 AM7/20/22
to sage-...@googlegroups.com
On 2022-07-17 17:42:34, Dima Pasechnik wrote:
> On Sun, Jul 17, 2022 at 5:08 PM Thierry <sage-goo...@lma.metelu.net> wrote:
> > while running a patchbot client, i see a lot of unfinished processes
> > whose command is "python3 /home/sagemath/sage/src/bin/sage-ipython -i"
> > at various dates, indicating that something is not killed properly. The
> > phenomenon is not new. Any hint on how to fix that ?
>
> this might have gotten broken in https://trac.sagemath.org/ticket/8784
>
> Namely, in this chunk:
>
> ...
>
> Maybe the author could say more.
>

I hope not. Before that ticket, the user was supposed to call
quit_sage() to e.g. properly free memory and terminate lingering
pexpect processes before leaving sage. When using sage interactively,
ipython made the call. But when using sage as a library, approximately
no one knew to call quit_sage() at the end of their code.

To address that, the ticket took everything that was in quit_sage()
and made it happen automatically when the process exits, so the user
is no longer responsible for calling quit_sage(), regardless of how
sage is being used. As a result, neither ipython nor the user should
need to call quit_sage().

But who knows. If that change caused it, it caused it.

Reply all
Reply to author
Forward
0 new messages