Github user zenglinxi0615 commented on the pull request:
https://github.com/apache/incubator-zeppelin/pull/319#issuecomment-142557390
There is a tricky way to simulate the bad connected socket situation:
(1) patch this code into zeppelin (this code is used to simulate the bad
connected socket situation, for example 1/5 probabilityï¼:
```
diff --git
a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
index aceea45..a0b3be6 100644
---
a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
+++
b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
@@ -66,6 +66,13 @@ public class NotebookSocket implements
WebSocket.OnTextMessage{
}
public void send(String serializeMessage) throws IOException {
+ if (Math.random() > 0.8) {
+ try {
+ Thread.sleep(30000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
connection.sendMessage(serializeMessage);
}
```
(2)compile the zeppelin code and setup an zeppelin server, for example:
localhost:8080
(3)open the url: localhost:8080 in several webpage
(4)refresh the webpages, after about five or six times, you will find that
you can't see any note in the home page of zeppelin, and opening new window is
not work too.
finally, if you patch my PR, and do the same thing as (1)~(4), you will
find that you can't see any note in the home page occasionally because of the
thread.sleep, but when you refresh the webpage or open a new window, the
problem is gone since a new websocket is created and send message successful.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---