GitHub user del680202 opened a pull request: https://github.com/apache/zeppelin/pull/1976
[ZEPPELIN-2037] Restart button does not work ### What is this PR for? When I enable authentication with ``shiro`` or switch interpreter mode to ``Per user & isolated``, ``Restart`` does not work and it is possible to make zombie process. * Environment: OS: CentOS 6 Zeppelin: master, branch-0.7 * Test flow: 1. Execute simple code such as ``sc.version`` 2. Click "Restart" button 3. Execute simple code again 4. Shutdown zeppelin 5. Monitor java processes  There are two issues in ``Restart`` button. * ``closeAndRemoveInterpreterGroupByUser`` does not work in some situations When I enable authentication, then ``closeAndRemoveInterpreterGroupByUser`` will be called by clicking "Restart" button. The implement of ``closeAndRemoveInterpreterGroupByUser`` call ``dereference`` only once, if ``remoteInterpreterProcess.referenceCount`` number larger than ``1``, then ``Restart`` button does not work. * ``closeAndRemoveInterpreterGroupByNoteId`` cloud not get correct processKey When I switch interpreter mode to ``Per user & isolated``, closeAndRemoveInterpreterGroupByNoteId will be called by clicking "Restart" button. And I will get ``intpKey=$username:`` and ``processKey=:``, therefore, ``isEqualInterpreterKeyProcessKey`` be false forever. I fix this issue by simple ways, but I only test ``spark``, ``python``, ``livy`` interpreters, maybe other interpreters have the same problem. ### What type of PR is it? Bug Fix ### Todos * [ ] - Add unit test ### What is the Jira issue? [ZEPPELIN-2037](https://issues.apache.org/jira/browse/ZEPPELIN-2037) ### How should this be tested? 1. Execute ``%spark sc.version`` on zeppelin 2. Click ``Restart`` button which in ``Notebook`` page or ``Interpreter`` Page 3. Monitor java processes by ``jps`` ### Screenshots (if appropriate) ### Questions: * Does the licenses files need update? * Is there breaking changes for older versions? * Does this needs documentation? You can merge this pull request into a Git repository by running: $ git pull https://github.com/del680202/zeppelin restart-bug-2037 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zeppelin/pull/1976.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 #1976 ---- commit 94f42f900d0afd447b07cce3ba474779bf566375 Author: Chin Tzulin <jp20316@w022341412910m.local> Date: 2017-02-06T05:31:22Z [ZEPPELIN-2037] Restart button does not work ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---