简体   繁体   中英

java.net.SocketException: Connection reset on TCP

So recently I have migrated my services (written in Java) to GCP from AWS. One of my service interacts with other service (both in GCP) through HTTP (java HttpClient). A very weird behaviour is happening where I am randomly getting java.net.SocketException: Connection reset like :-

Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:210) ~[na:1.8.0_151] at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_151] at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) ~[na:1.8.0_151] at sun.security.ssl.InputRecord.read(InputRecord.java:503) ~[na:1.8.0_151] at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983) ~[na:1.8.0_151] at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940) ~[na:1.8.0_151] at sun.security.ssl.AppInputStream.read(AppInputStream.java:105) ~[na:1.8.0_151]

This thing never happened in AWS but is happening in GCP with the same code. To me it seems that something is off about the machine configuration. I have tried changing the machines with no luck. Can anyone suggest what could be wrong here possibly?

您是否创建了防火墙规则来接受从一个实例到另一个实例传入流量?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM