Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-15849

Incorrect use Zookeeper 4LW

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 7.5, 8.10.1
    • 9.0, 8.11.2
    • Admin UI
    • None

    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

          Activity

            People

              janhoy Jan Høydahl
              q6364325 Fa Ming
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m