We have postgresql database version 9.5.9 in production set up.We occasionally face below error.So we need to restart application process to fix it.(droped connection from application end and start again) but its not ideal solution.
Error :- org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend. Caused by: java.net.SocketException: Connection reset by peer: socket write error
We need help to fix this error.
Probably a firewall or gateway dropping the connections that they perceive as being idle. What does the PostgreSQL server log have to say about it? If both ends accuse the other of closing the connection, it is probably due to active interference.
Seems like your application should be designed to recover from this without a full restart.