In one of my applications, we got to another server using HttpURLConnection - the application worked fine for several months, and now all of a sudden, all bumps collide with the connection timeout. With interruptions, several calls (1 out of 500) succeed, while all others fail. The application is deployed on Linux running on Java 5 with Tomcat 5.5. I tried curl and wget from the command line, which work fine.
Another Java process that uses exactly the same code base can make connections from the command line. We restarted the tomcat server as well as the machine, but to no avail. We thoroughly checked the machine, and there are no blocking processes / firewalls preventing this (it is obvious that other Java processes are capable of creating connections).
In discontinuous queues (say, once a day), an application can establish several connections, and then return to a broken state. Not much is visible from the stack trace.
Any suggestions where this might happen wrong?
[Refresh] If you change the serverβs DNS server when starting the application, Java will not select this, and connections will be disconnected from the old IP address (if the IP address does not work). Thus, in the case of CDN, if a node is omitted and replaced by another IP, a problem may arise.
source
share