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 2021/10/21 06:31:09 UTC

[GitHub] [zeppelin] Reamer opened a new pull request #4260: [ZEPPELIN-5569] Implement onError

Reamer opened a new pull request #4260:
URL: https://github.com/apache/zeppelin/pull/4260


   ### What is this PR for?
   This PR implement `OnError`, which is necessary to cleanup the connectionManager, if possible.
   
   ### What type of PR is it?
   - BugFix
   
   ### What is the Jira issue?
   * https://issues.apache.org/jira/browse/ZEPPELIN-5569
   
   ### How should this be tested?
   * I have done some manual testing, but it is difficult to test this case.
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   


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

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] Reamer commented on a change in pull request #4260: [ZEPPELIN-5569] Implement onError

Posted by GitBox <gi...@apache.org>.
Reamer commented on a change in pull request #4260:
URL: https://github.com/apache/zeppelin/pull/4260#discussion_r830903060



##########
File path: zeppelin-server/src/main/java/org/apache/zeppelin/utils/ServerUtils.java
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zeppelin.utils;
+
+import javax.websocket.Session;
+
+public class ServerUtils {
+  private ServerUtils() {
+    // do nothing
+  }
+
+  /**
+   *
+   * @param session
+   * @return the remote address of the websocket or "unknown" if session is null
+   */
+  public static String getRemoteAddress(Session session) {

Review comment:
       Yes, I agree with that.




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

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] Reamer commented on a change in pull request #4260: [ZEPPELIN-5569] Implement onError

Posted by GitBox <gi...@apache.org>.
Reamer commented on a change in pull request #4260:
URL: https://github.com/apache/zeppelin/pull/4260#discussion_r733566247



##########
File path: zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
##########
@@ -495,22 +497,33 @@ public void onMessage(NotebookSocket conn, String msg) {
   @OnClose
   public void onClose(Session session, CloseReason closeReason) throws IOException {
     NotebookSocket notebookSocket = sessionIdNotebookSocketMap.get(session.getId());
-    if (null == notebookSocket) {
-      session.close();

Review comment:
       @jongyoul I think that session.close() is unnecessary, because the session is already closed.




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

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] Reamer commented on a change in pull request #4260: [ZEPPELIN-5569] Implement onError

Posted by GitBox <gi...@apache.org>.
Reamer commented on a change in pull request #4260:
URL: https://github.com/apache/zeppelin/pull/4260#discussion_r733566247



##########
File path: zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
##########
@@ -495,22 +497,33 @@ public void onMessage(NotebookSocket conn, String msg) {
   @OnClose
   public void onClose(Session session, CloseReason closeReason) throws IOException {
     NotebookSocket notebookSocket = sessionIdNotebookSocketMap.get(session.getId());
-    if (null == notebookSocket) {
-      session.close();

Review comment:
       @jongyoul I think that `session.close()` is unnecessary, because the session is already closed.




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

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] jongyoul commented on a change in pull request #4260: [ZEPPELIN-5569] Implement onError

Posted by GitBox <gi...@apache.org>.
jongyoul commented on a change in pull request #4260:
URL: https://github.com/apache/zeppelin/pull/4260#discussion_r743416603



##########
File path: zeppelin-server/src/main/java/org/apache/zeppelin/utils/ServerUtils.java
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zeppelin.utils;
+
+import javax.websocket.Session;
+
+public class ServerUtils {
+  private ServerUtils() {
+    // do nothing
+  }
+
+  /**
+   *
+   * @param session
+   * @return the remote address of the websocket or "unknown" if session is null
+   */
+  public static String getRemoteAddress(Session session) {

Review comment:
       nit. I think we could move this logic into `NotebookServer` after removing `NotebookSocket`




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

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] jongyoul commented on a change in pull request #4260: [ZEPPELIN-5569] Implement onError

Posted by GitBox <gi...@apache.org>.
jongyoul commented on a change in pull request #4260:
URL: https://github.com/apache/zeppelin/pull/4260#discussion_r743416603



##########
File path: zeppelin-server/src/main/java/org/apache/zeppelin/utils/ServerUtils.java
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zeppelin.utils;
+
+import javax.websocket.Session;
+
+public class ServerUtils {
+  private ServerUtils() {
+    // do nothing
+  }
+
+  /**
+   *
+   * @param session
+   * @return the remote address of the websocket or "unknown" if session is null
+   */
+  public static String getRemoteAddress(Session session) {

Review comment:
       nit. I think we could move this logic into `NotebookServer` after removing `NotebookSocket`




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

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] Reamer commented on pull request #4260: [ZEPPELIN-5569] Implement onError

Posted by GitBox <gi...@apache.org>.
Reamer commented on pull request #4260:
URL: https://github.com/apache/zeppelin/pull/4260#issuecomment-1074830441


   If no other comments are received, I will include this PR in the master on Friday.


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

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] jongyoul commented on a change in pull request #4260: [ZEPPELIN-5569] Implement onError

Posted by GitBox <gi...@apache.org>.
jongyoul commented on a change in pull request #4260:
URL: https://github.com/apache/zeppelin/pull/4260#discussion_r743416603



##########
File path: zeppelin-server/src/main/java/org/apache/zeppelin/utils/ServerUtils.java
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zeppelin.utils;
+
+import javax.websocket.Session;
+
+public class ServerUtils {
+  private ServerUtils() {
+    // do nothing
+  }
+
+  /**
+   *
+   * @param session
+   * @return the remote address of the websocket or "unknown" if session is null
+   */
+  public static String getRemoteAddress(Session session) {

Review comment:
       nit. I think we could move this logic into `NotebookServer` after removing `NotebookSocket`




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

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] asfgit closed pull request #4260: [ZEPPELIN-5569] Implement onError

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #4260:
URL: https://github.com/apache/zeppelin/pull/4260


   


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

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org