this problem is reported in:
https://issues.apache.org/jira/browse/ZEPPELIN-312

2015-09-22 15:05 GMT+08:00 linxi zeng <linxizeng0...@gmail.com>:

> and the problem can reproduce by:
>
> *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..35c3696 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,11 @@* public class NotebookSocket implements
> WebSocket.OnTextMessage{
>
>    }
>
>
>
>    public void send(String serializeMessage) throws IOException {
>
> *+    try {*
>
> *+      Thread.sleep(30000);*
>
> *+    } catch (InterruptedException e) {*
>
> *+      e.printStackTrace();*
>
> *+    }*
>
>      connection.sendMessage(serializeMessage);
>
>    }
>
> 2015-09-22 14:59 GMT+08:00 linxi zeng <linxizeng0...@gmail.com>:
>
>> hi, moon:
>> Recently, we often encounter a same problem when open some web url (ex.
>> localhost:8080) to access zeppelin server, there are no note show in the
>> web page, and refresh the web page did't work. Then we find the error info
>> in zeppelin logs:
>>
>>
>> --------------------------------------------------------------------------------------------------------------------------------
>> INFO [2015-09-22 10:05:43,360] ({qtp489396160-1328}
>> NotebookServer.java[onMessage]:101) - RECEIVE << PING
>> INFO [2015-09-22 10:05:43,360] ({qtp489396160-1328}
>> NotebookServer.java[onMessage]:101) - RECEIVE << PING
>> INFO [2015-09-22 10:05:43,360] ({qtp489396160-1328}
>> NotebookServer.java[onMessage]:101) - RECEIVE << PING
>> INFO [2015-09-22 10:05:43,590] ({qtp489396160-1329}
>> NotebookServer.java[onOpen]:89) - New connection from xxx : 49725
>> INFO [2015-09-22 10:05:43,619] ({qtp489396160-1329}
>> NotebookServer.java[onMessage]:101) - RECEIVE << LIST_NOTES
>> ERROR [2015-09-22 10:05:43,620] ({qtp489396160-1329}
>> NotebookServer.java[broadcastAll]:270) - socket error
>> java.io.IOException: closedOut 1001:null
>> at
>> org.eclipse.jetty.websocket.WebSocketConnectionRFC6455$WSFrameConnection.sendMessage(WebSocketConnectionRFC6455.java:437)
>> at org.apache.zeppelin.socket.NotebookSocket.send(NotebookSocket.java:69)
>> at
>> org.apache.zeppelin.socket.NotebookServer.broadcastAll(NotebookServer.java:268)
>> at
>> org.apache.zeppelin.socket.NotebookServer.broadcastNoteList(NotebookServer.java:302)
>> at
>> org.apache.zeppelin.socket.NotebookServer.onMessage(NotebookServer.java:105)
>> at
>> org.apache.zeppelin.socket.NotebookSocket.onMessage(NotebookSocket.java:56)
>> at
>> org.eclipse.jetty.websocket.WebSocketConnectionRFC6455$WSFrameHandler.onFrame(WebSocketConnectionRFC6455.java:835)
>> at
>> org.eclipse.jetty.websocket.WebSocketParserRFC6455.parseNext(WebSocketParserRFC6455.java:349)
>> at
>> org.eclipse.jetty.websocket.WebSocketConnectionRFC6455.handle(WebSocketConnectionRFC6455.java:225)
>> at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
>> at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
>> at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>> at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>> at java.lang.Thread.run(Thread.java:745)
>> INFO [2015-09-22 10:05:43,698] ({qtp489396160-1328}
>> NotebookServer.java[onMessage]:101) - RECEIVE << PING
>> INFO [2015-09-22 10:05:43,698] ({qtp489396160-1328}
>> NotebookServer.java[onMessage]:101) - RECEIVE << PING
>> INFO [2015-09-22 10:05:43,698] ({qtp489396160-1328}
>> NotebookServer.java[onMessage]:101) - RECEIVE << PING
>> INFO [2015-09-22 10:05:43,698] ({qtp489396160-1328}
>> NotebookServer.java[onMessage]:101) - RECEIVE << PING
>>
>> -----------------------------------------------------------------------------------------------------------
>>
>> in the NotebookServer.java we find that when we access the zeppelin web,
>> it will call broadcastNoteList(), and then broadcastNoteList will call
>> broadcastAll():
>> {noformat}
>>   private void broadcastAll(Message m) {
>>     synchronized (connectedSockets) {
>>       for (NotebookSocket conn : connectedSockets) {
>>         try {
>>           conn.send(serializeMessage(m));
>>         } catch (IOException e) {
>>           LOG.error("socket error", e);
>>         }
>>       }
>>     }
>>   }
>>
>>
>> ------------------------------------------------------------------------------------------------------------------------
>> the broadcaseAll function will call conn.send(serializeMessage(m))  one
>> by one to send message, and if one conn has some problem say: closed or
>> send message timeout, it will block the other socket to get the message, so
>> some zeppelin web url can't show any note in home page.
>> I think it's better to:
>> (1)judge if the conn is open before call conn.send(serializeMessage(m));
>> (2)call conn.send(serializeMessage(m)) concurrently
>>
>
>

Reply via email to