ERROR 20444 --- [o-8090-exec-221] c.h.common.exception.RRExceptionHandler : java.io.IOException: B

Project scenario:

简单说明如下:
Recently, there have been a lot of intensive users, and the same interface has been requested frequently, causing the system to report an error and directly stop the service.


Problem Description

提示:这里描述项目中遇到的问题:

The error message is as follows:

 ERROR 20444 --- [o-8090-exec-221] c.h.common.exception.RRExceptionHandler  : java.io.IOException: Broken pipe

org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe

Cause Analysis:

Tip: Fill in the analysis of the problem here:

Caused by: java.io.IOException: Broken pipe
	at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
	at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
	at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
	at sun.nio.ch.IOUtil.write(IOUtil.java:65)
	at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:468)
	at org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:134)
	at org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:105)
	at org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:144)
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.doWrite(NioEndpoint.java:1223)
	at org.apache.tomcat.util.net.SocketWrapperBase.doWrite(SocketWrapperBase.java:743)
	at org.apache.tomcat.util.net.SocketWrapperBase.flushBlocking(SocketWrapperBase.java:696)
	at org.apache.tomcat.util.net.SocketWrapperBase.flush(SocketWrapperBase.java:686)
	at org.apache.coyote.http11.Http11OutputBuffer$SocketOutputBuffer.flush(Http11OutputBuffer.java:553)
	at org.apache.coyote.http11.filters.IdentityOutputFilter.flush(IdentityOutputFilter.java:117)
	at org.apache.coyote.http11.Http11OutputBuffer.flush(Http11OutputBuffer.java:216)
	at org.apache.coyote.http11.Http11Processor.flush(Http11Processor.java:1149)
	at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:394)
	at org.apache.coyote.Response.action(Response.java:209)
	at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:295)
	... 108 common frames omitted

Through the above error information, we first analyze the problem:
the possibility of the above error:
(1) The user requests server data, and the server suddenly stops running.
(2). There are too many connections in the connection pool, exceeding the set maximum number of connections. The processing speed of each connection is too slow, which makes it impossible to process, so the connection is disconnected. (3) The client requests server
data, and the service The client returns normally, but the client is disconnected due to connection timeout or other reasons, causing the server to have no return channel.
(4) The request message and return parameters are too large, causing the client to terminate the connection on its own.
(5) The file is too large: The processing time is too long. Due to the long execution time or high frequency, the program or server times out and directly terminates the process.
(6) Consider whether there is an infinite loop call in the code, database configuration problem or JVM configuration is too low, JVM garbage is not recycled (
7), it may also be caused by abnormal calls to other services, or other reasons The library is locked while the service is querying.

solution:

Solution:

1. Increase the number of database connection pools, that is, the value of max-active in the configuration file;
(MaxActive, the maximum number of database connections in the connection pool. Set to 0 to indicate no limit.)

2. Extend the client timeout.
(maxWait, the maximum waiting time to establish a connection. If this time is exceeded, an exception will be received. Set to -1 to indicate no limit.)

3. Check whether there are nested loops or infinite loops in the code.

3. Check whether there are deadlocks in the database tables during runtime.

The problem I encountered this time was due to a deadlock in the encoding-related data table when querying the database when calling the interface. I will record it here.

Guess you like

Origin blog.csdn.net/YHLSunshine/article/details/131646614