Description
Error code location:
org.apache.solr.handler.admin.ZookeeperStatusHandler
getZkRawResponse() try ( Socket socket = new Socket(host, port); Writer writer = new OutputStreamWriter(socket.getOutputStream(), "utf-8"); PrintWriter out = new PrintWriter(writer, true); BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream(), "utf-8"));) { out.println(fourLetterWordCommand); List<String> response = in.lines().collect(Collectors.toList()); log.debug("Got response from ZK on host {} and port {}: {}", host, port, response);
Zookeeper only accepts 4LW, but solr socket sends 4LW with \n.
After reading 4LW, ZooKeeper will call the close method to close the socket. At this time, there will be \n unread in the cache, which will cause the connection that should send FIN to release will be changed to RST, and the solr socket client will throw it out in some cases. The exception (java.net.SocketException: Connection reset) which causes the Solr Admin UI interface zkStatus to be yellow.
Here is some amendments by myself:
getZkRawResponse() try ( Socket socket = new Socket(host, port); Writer writer = new OutputStreamWriter(socket.getOutputStream(), "utf-8"); PrintWriter out = new PrintWriter(writer, true); BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream(), "utf-8"));) { out.print(fourLetterWordCommand); out.flush(); List<String> response = in.lines().collect(Collectors.toList()); log.debug("Got response from ZK on host {} and port {}: {}", host, port, response);
Attachments
Issue Links
- links to