Github user zenglinxi0615 commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/267#issuecomment-136373818
  
    I found a way to make RemoteInterpreterServer deadlock recurrently:
    (1)Patch these codes and recompile zeppelin:
    ```
    diff --git 
a/spark/src/main/java/org/apache/zeppelin/spark/PySparkInterpreter.java 
b/spark/src/main/java/org/apache/zeppelin/spark/PySparkInterpreter.java
    index 852dd33..17e877a 100644
    --- a/spark/src/main/java/org/apache/zeppelin/spark/PySparkInterpreter.java
    +++ b/spark/src/main/java/org/apache/zeppelin/spark/PySparkInterpreter.java
    @@ -345,6 +345,11 @@ public class PySparkInterpreter extends Interpreter 
implements ExecuteResultHand
       private SparkInterpreter getSparkInterpreter() {
         InterpreterGroup intpGroup = getInterpreterGroup();
         synchronized (intpGroup) {
    +      try {
    +        Thread.sleep(20000);
    +      } catch (InterruptedException e) {
    +        e.printStackTrace();
    +      }
           for (Interpreter intp : getInterpreterGroup()){
             if (intp.getClassName().equals(SparkInterpreter.class.getName())) {
               Interpreter p = intp;
    diff --git 
a/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java 
b/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java
    index a4ff494..7b191aa 100644
    --- a/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java
    +++ b/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java
    @@ -329,6 +329,11 @@ public class SparkInterpreter extends Interpreter {
     
       @Override
       public void open() {
    +    try {
    +      Thread.sleep(20000);
    +    } catch (InterruptedException e) {
    +      e.printStackTrace();
    +    }
         URL[] urls = getClassloaderUrls();
     
         // Very nice discussion about how scala compiler handle classpath
    ```
    
    (2)set zeppelin.spark.concurrentSQL=true
    
    (3)restart zeppeplin server
    
    (4)run %pyspark and %sql paragraph in the same time (a few seconds Interval 
is just ok)
    
    (5)monitor RemoteInterpreterServer with jstack, then you will get a deadlock


---
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.
---

Reply via email to