GitHub user AlexanderShoshin opened a pull request: https://github.com/apache/zeppelin/pull/2246
[ZEPPELIN-1828] Flaky Test: RemoteInterpreterTest hanged in zeppelin-interpreter ### What is this PR for? When `interpreter.close()` occurs in code it shuts down _RemoteInterpreterEventPoller_ and then tries to close thrift connection. While closing thrift client will wait until events queue is empty. If _RemoteInterpreterEventPoller_ has not processed all thrift events before the shutdown signal comes, thrift client will wait forever. As a result Travis will terminate the build after code is not responding for 10 minutes. ### What type of PR is it? [Bug Fix] ### Todos We need to: * [ ] - write a test that checks that event queue is empty after _RemoteInterpreterEventPoller_ is done, * [ ] - clear unread events on _RemoteInterpreterEventPoller_ shutdown signal. ### What is the Jira issue? [ZEPPELIN-1828](https://issues.apache.org/jira/browse/ZEPPELIN-1828) ### How should this be tested? This issue can be reprodused if you put `Thread.sleep(3000L);` to _RemoteInterpreterEventPoller.java_ ``` ... } else if (event.getType() == RemoteInterpreterEventType.OUTPUT_UPDATE_ALL) { Thread.sleep(3000L); ... } ``` and run _RemoteInterpreterTest.java_. ### Questions: * Does the licenses files need update? **no** * Is there breaking changes for older versions? **no** * Does this needs documentation? **no** You can merge this pull request into a Git repository by running: $ git pull https://github.com/AlexanderShoshin/zeppelin ZEPPELIN-1828 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zeppelin/pull/2246.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 #2246 ---- commit 66fe9c7c480f4dfdb5e7e00eff7198b99e2d3bac Author: Alexander Shoshin <alexander_shos...@epam.com> Date: 2017-04-12T08:03:54Z test that EventPoller clear unread events on shutdown commit 5818a83d638fdf77f0b6f146f669ad523bb0e10c Author: Alexander Shoshin <alexander_shos...@epam.com> Date: 2017-04-12T08:04:31Z clear unread events on shutdown ---- --- 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. ---