Skip to content

signal handling #14675

@jtravs

Description

@jtravs

It would be very useful for there to be an official way for users to register signal handlers in julia programmes. In particular I'd like to be able to handle SIGNIT and SIGHUP, but there is no reason it shouldn't be more general, like python's signal module (https://docs.python.org/2/library/signal.html).

I know that signals are used a little in base julia (presumably through libuv?), and can see some code related to internal uses of signals, but what do people think about user facing mechanism?

My need is that on our compute servers the management software informs simulation runs that they need to save state and temporarily shut down (to be moved to other nodes or for maintenance etc.) using SIGINT and SIGHUP. Currently my code is in python and C++ but for the last couple of years I have been slowly migrating modules to julia. This code often runs for more than a month continuously and needs to sometimes be suspended. I know I could hack my own version with ccall, but think this might be more generally useful.

I'm happy to have a go at this.

I raided the same question on the julia-user list: https://groups.google.com/d/topic/julia-users/l0HJVCYriko/discussion

Metadata

Metadata

Assignees

No one assigned

    Labels

    error handlingHandling of exceptions by Julia or the user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions