3

我将 Solr 4.3 与 tomcat7 一起使用。当并发写入和读取的数量增加时,会抛出此 SocketException 错误。我通过多个客户端进行并发提交和搜索。任何形式的帮助表示赞赏。这是tomcat日志(catalina.out)和solr.log

 tomcat log(catalina.out):

    59887611 [http-bio-8080-exec-988] ERROR org.apache.solr.servlet.SolrDispatchFilter  – null:ClientAbortException:  java.net.SocketException: Broken pipe
     at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:406)
     at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:342)
     at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:431)
     at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:419)
     at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:91)
     at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
     at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282)
     at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)
     at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207)
     at org.apache.solr.util.FastWriter.flush(FastWriter.java:141)
     at org.apache.solr.util.FastWriter.write(FastWriter.java:126)
     at java.io.Writer.write(Writer.java:157)
     at org.apache.solr.response.XMLWriter.startTag(XMLWriter.java:144)
     at org.apache.solr.response.XMLWriter.writePrim(XMLWriter.java:347)
     at org.apache.solr.response.XMLWriter.writeLong(XMLWriter.java:305)
     at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:139)
     at org.apache.solr.schema.TrieField.write(TrieField.java:221)
     at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:130)
     at org.apache.solr.response.XMLWriter.writeSolrDocument(XMLWriter.java:199)
     at org.apache.solr.response.TextResponseWriter.writeDocuments(TextResponseWriter.java:275)
     at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:172)
     at org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:111)
     at org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:39)
     at org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:644)
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:372)
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:155)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
     at java.lang.Thread.run(Thread.java:724)
    Caused by: java.net.SocketException: Broken pipe
     at java.net.SocketOutputStream.socketWrite0(Native Method)
     at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
     at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
     at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:215)
     at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480)
     at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:366)
     at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:240)
     at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:119)
     at org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputBuffer.java:192)
     at org.apache.coyote.Response.doWrite(Response.java:517)
     at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:401)
     ... 39 more


         solr.log:



    2013-09-19 05:32:13.978; org.apache.solr.common.SolrException; null:ClientAbortException:  java.net.SocketException: Broken pipe
     at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:406)
     at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:342)
     at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:431)
     at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:419)
     at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:91)
     at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
     at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282)
     at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)
     at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207)
     at org.apache.solr.util.FastWriter.flush(FastWriter.java:141)
     at org.apache.solr.util.FastWriter.write(FastWriter.java:126)
     at java.io.Writer.write(Writer.java:157)
     at org.apache.solr.response.XMLWriter.startTag(XMLWriter.java:144)
     at org.apache.solr.response.XMLWriter.writePrim(XMLWriter.java:347)
     at org.apache.solr.response.XMLWriter.writeLong(XMLWriter.java:305)
     at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:139)
     at org.apache.solr.schema.TrieField.write(TrieField.java:221)
     at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:130)
     at org.apache.solr.response.XMLWriter.writeSolrDocument(XMLWriter.java:199)
     at org.apache.solr.response.TextResponseWriter.writeDocuments(TextResponseWriter.java:275)
     at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:172)
     at org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:111)
     at org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:39)
     at org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:644)
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:372)
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:155)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
     at java.lang.Thread.run(Thread.java:724)
    Caused by: java.net.SocketException: Broken pipe
     at java.net.SocketOutputStream.socketWrite0(Native Me...
4

2 回答 2

0

这是更底层的错误。我在stackoverflow中找到了这个问题和答案,解决方案的总结是验证你是否真的关闭了所有的套接字(这将是间接地由于框架)并检查它是否没有吞下其他异常(比如它需要更多的内存) .

于 2013-09-19T13:17:25.887 回答
0

对等方已关闭连接。例如,浏览器选项卡已关闭,或已导航到另一个页面。在你的最后,你可以或不需要做任何事情。你不能再写任何回应,所以停止尝试。

于 2016-02-25T09:52:24.837 回答