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 <[email protected]>
Date: 2017-09-11T16:09:53Z
[TOREE-437] Establish alternate interrupt handler for background execution
----
---