[
https://issues.apache.org/jira/browse/SOLR-15849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17536149#comment-17536149
]
ASF subversion and git services commented on SOLR-15849:
--------------------------------------------------------
Commit b1779a63bdb4f49a8448621e407eaff82187f052 in lucene-solr's branch
refs/heads/branch_8_11 from Fa Ming
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=b1779a63bdb ]
SOLR-15849 Incorrect use Zookeeper 4LW (#458)
Back-ported from
https://github.com/apache/solr/commit/48ffa68aecc98b5ff0489705520d0cd1e81a1a09
> Incorrect use Zookeeper 4LW
> ----------------------------
>
> Key: SOLR-15849
> URL: https://issues.apache.org/jira/browse/SOLR-15849
> Project: Solr
> Issue Type: Bug
> Components: Admin UI
> Affects Versions: 7.5, 8.10.1
> Reporter: Fa Ming
> Assignee: Jan Høydahl
> Priority: Minor
> Fix For: 9.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> {*}Error code location{*}:
> org.apache.solr.handler.admin.ZookeeperStatusHandler
> {code:java}
> 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);
> {code}
>
> 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.
>
> {*}H{*}{*}ere is some amendments by myself:{*}
> {code:java}
> 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);
> {code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]