应用的日志发现大量的,
org.eclipse.jetty.io.RuntimeIOException: org.eclipse.jetty.io.EofException .... Caused by: org.eclipse.jetty.io.EofException .... Caused by: java.io.IOException: Broken pipe at sun.nio.ch.FileDispatcher.write0(Native Method) at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29) at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104) at sun.nio.ch.IOUtil.write(IOUtil.java:60) at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334) at org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:187) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:277) at org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:856)
从异常日志可知是jetty准备会写response发现connection已经被关闭导致。
http2.2.15+mod_proxy+jetty7.2.0
mod_proxy连接池配置
<IfModule mod_proxy.c> ProxyRequests Off ProxyPreserveHost On <Directory proxy:*> Order deny,allow Allow from all </Directory> ProxyPassMatch ^/(module1|module2)/(.*)$ http://localhost:2200 min=5 smax=16 max=64 ttl=600 timeout=30 </IfModule>
用tcpdump抓包
tcpdump -i eth0 -w /tmp/eof.dat port 80
用wireshark分析发现都是client端主动断开
对这个异常目前的解决方案是,将jetty io类UncheckedPrintWriter crack掉
其中的属性_throwUnchecked=true正式控制异常是否向上抛出的开关,把它修改掉,然后将这个class单独打成jar包。
启动是添加 java -jar start.jar lib=/home/admin (假设crack的jar包在admin目录下)