websocket连接 中断 Broken pipe

Nov 27, 2017 11:21:50 PM org.apache.coyote.AbstractProcessor setErrorState
INFO: An error occurred in processing while on a non-container thread. The connection will be closed immediately
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.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:119)
at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:801)
at org.apache.coyote.Response.action(Response.java:172)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:363)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:331)
at org.apache.catalina.connector.Response.flushBuffer(Response.java:611)
at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:306)
at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:160)
at org.springframework.boot.context.web.ErrorPageFilter$ErrorWrapperResponse.flushBuffer(ErrorPageFilter.java:317)
at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:160)
at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:160)
at org.springframework.security.web.context.OnCommittedResponseWrapper.flushBuffer(OnCommittedResponseWrapper.java:143)
at org.springframework.security.web.context.SaveContextOnUpdateOrErrorResponseWrapper.flushBuffer(SaveContextOnUpdateOrErrorResponseWrapper.java:40)
at org.springframework.http.server.ServletServerHttpResponse.flush(ServletServerHttpResponse.java:91)
at org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.writeFrameInternal(AbstractHttpSockJsSession.java:345)
at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame(AbstractSockJsSession.java:325)
at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.sendHeartbeat(AbstractSockJsSession.java:249)
at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession$1.run(AbstractSockJsSession.java:269)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

2个回答

这种情况通常是client(客户)端主动中断连接, 不需要处理,也没法处理。忽略即可。
如果发生频繁,中间有web服务器话,可以检查一下连接时间和数据传输时间设置,看是不是连接超时被类似nginx或apache服务器强制中断了。

Daolee
Daolee 回复COCO_AS: 谢谢你的回答,这个问题持续时间很久了,起初没发现,后面才发现websocket 连接不了,必须重启才可以连接。
接近 3 年之前 回复
Daolee
Daolee 回复COCO_AS: 谢谢你的回答,这个问题持续时间很久了,起初没发现,后面才发现websocket 连接不了,必须重启才可以连接。
接近 3 年之前 回复

谢谢你的回答,这个问题持续时间很长了,积累时间久了就连接不到websocket 然后后台服务器重启才可以正常使用。

qq_33809501
唯乔 大佬解决没有啊 我们现在linux上部署也是这个问题
5 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐