aib628 commented on a change in pull request #4186: URL: https://github.com/apache/zeppelin/pull/4186#discussion_r686635143
########## File path: zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java ########## @@ -263,19 +263,17 @@ public void onMessage(NotebookSocket conn, String msg) { } TicketContainer.Entry ticketEntry = TicketContainer.instance.getTicketEntry(receivedMessage.principal); - if (ticketEntry != null && - (!ticketEntry.getTicket().equals(receivedMessage.ticket))) { + if (ticketEntry == null || StringUtils.isEmpty(ticketEntry.getTicket())) { + LOG.debug("{} message: invalid ticket {}", receivedMessage.op, receivedMessage.ticket); + return; + } else if (!ticketEntry.getTicket().equals(receivedMessage.ticket)) { /* not to pollute logs, log instead of exception */ if (StringUtils.isEmpty(receivedMessage.ticket)) { - LOG.debug("{} message: invalid ticket {} != {}", receivedMessage.op, - receivedMessage.ticket, ticketEntry.getTicket()); - } else { - if (!receivedMessage.op.equals(OP.PING)) { - conn.send(serializeMessage(new Message(OP.SESSION_LOGOUT).put("info", - "Your ticket is invalid possibly due to server restart. " - + "Please login again."))); - } + LOG.debug("{} message: invalid ticket {} != {}", receivedMessage.op, receivedMessage.ticket, ticketEntry.getTicket()); Review comment: This is an existing code fragment, and it means send logout messages to client when invalid ticket, i think we can keep it. -- 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-unsubscr...@zeppelin.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org