You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@toree.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/09/11 16:21:00 UTC

[jira] [Commented] (TOREE-437) Cell interrupts do not occur in background

    [ https://issues.apache.org/jira/browse/TOREE-437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16161510#comment-16161510 ] 

ASF GitHub Bot commented on TOREE-437:
--------------------------------------

GitHub user kevin-bates opened a pull request:

    https://github.com/apache/incubator-toree/pull/140

    [TOREE-437] Establish alternate interrupt handler for background execution

    Cell interrupts do not take place if Toree is running in the background (typically due to its parent being in the background).  This PR adds support for the caller of Toree to specify an alternate interrupt signal via the environment variable `TOREE_ALTERNATE_SIGINT` - the value of which should be the string indicating the alternate signal name's suffix portion (e.g., "USR2" for `SIGUSR2`).
    The common scenario would be to specify this env value in the kernel.json's `env:` stanza when necessary ...
    ```json
      "display_name": "Apache Toree - Scala",
      "env": {
        "DEFAULT_INTERPRETER": "Scala",
        "PYTHON_EXEC": "python",
        "__TOREE_SPARK_OPTS__": "",
        "__TOREE_OPTS__": "",
        "TOREE_ALTERNATE_SIGINT": "USR2",
    ```
    
    If the value of `TOREE_ALTERNATE_SIGINT` is not recognized as a valid signal name, a warning message will be logged, but the kernel's launch will proceed:
    ```
    17/09/11 08:44:37 [WARN] o.a.t.Main$$anon$1 - Error occurred establishing alternate signal handler.  Value of TOREE_ALTERNATE_SIGINT is probably bad: FOO.  Error: Unknown signal: FOO
    ```
    
    Fixes TOREE-437

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kevin-bates/incubator-toree alt-interrupt-signal

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-toree/pull/140.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #140
    
----
commit be78e5474b0b97a87a88ba35098af3aeb381edf4
Author: Kevin Bates <ke...@us.ibm.com>
Date:   2017-09-11T16:09:53Z

    [TOREE-437] Establish alternate interrupt handler for background execution

----


> Cell interrupts do not occur in background
> ------------------------------------------
>
>                 Key: TOREE-437
>                 URL: https://issues.apache.org/jira/browse/TOREE-437
>             Project: TOREE
>          Issue Type: Improvement
>          Components: Kernel
>    Affects Versions: 0.2.0
>            Reporter: Kevin Bates
>            Assignee: Kevin Bates
>              Labels: usability
>
> Whenever Toree is run in the background - either directly from the shell or indirectly from the Jupyter stack that is started in the background - cell interrupts (via ctrl-C or SIGINT from parent) are not received - resulting in the inability to interrupt long-running cells.
> This can be most simply demonstrated by invoking run.sh into the background (e.g., run.sh &) then issue ctrl-C (or `kill -2 <pid>`) to no avail.
> This is related to TOREE-33 but only pertains to cell interrupt functionality since complete life-cycle management is assumed by the parent for the shutdown (double ctrl-C) scenario.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)