You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2019/11/19 12:28:20 UTC

[GitHub] [zeppelin] MOBIN-F commented on a change in pull request #3523: [ZEPPELIN-4326][spark]Spark Interpreter restart failed when no suffic…

MOBIN-F commented on a change in pull request #3523: [ZEPPELIN-4326][spark]Spark Interpreter restart failed when no suffic…
URL: https://github.com/apache/zeppelin/pull/3523#discussion_r347894619
 
 

 ##########
 File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/LazyOpenInterpreter.java
 ##########
 @@ -32,6 +34,7 @@
     implements WrappedInterpreter {
   private Interpreter intp;
   volatile boolean opened = false;
+  private Lock lock = new ReentrantLock();
 
 Review comment:
   I think it can be changed like this?
   ```
     public void open() throws InterpreterException {
       if (lock.tryLock()) {
         try {
           if (opened == true) {
             return;
           } else {
             intp.open();
             opened = true;
           }
         } finally {
           lock.unlock();
         }
       }
     }
   ```
   But now I don't understand why the 0.8 version of LazyInterpreter.open needs two synchronized?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services