Error Reported When a Request Is Executed Through an Existing Connection
Scenario
When a client executes a request through an existing connection, the following error information is displayed:
- Error 1
org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
- Error 2
org.postgresql.util.PSQLException: The connection attempt failed ... Caused by: java.net.SocketException: Connection reset
Solution to Error 1
Possible causes:
- There are too many parameters in the SQL statement.
- The connection has been released.
Solution:
- If there are too many parameters in the SQL statement, split the SQL statement.
- If the connection has been released, check the client connection parameters, such as the connection timeout interval. Add an automatic retry mechanism for your client.
Solution to Error 2
This error is reported when a connection that has been released is used. The possible causes are as follows:
- There are problems with network connectivity.
- The instance is being rebooted or the backend process crashes.
- Idle connections are released upon timeout.
Solution:
- Check the network connectivity and determine whether the disconnection is caused by network link factors (such as high packet loss rate and retransmission rate).
- If there are no network problems, check for other errors.
- If no, check the connection timeout parameters (such as sockettimeout and connecttimeout for the JDBC connection pool). If the values are too small, connections can be released automatically.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot