Applies to:
Oracle 11.2.0.4
on Linux Platform
Symptoms:
example 1:
Caused by: java.sql.SQLRecoverableException: Erreur d'E/S: Connection reset
example 2:
ORACLE CONNECTION PROBLEM (Attempt number 1 of 3) MESSAGE:Cannot create PoolableConnectionFactory (Erreur d'E/S: Connection reset)]
example 3:
return jpype.java.sql.DriverManager.getConnection(*driver_args)
jpype._jexception.SQLRecoverableExceptionPyRaisable: java.sql.SQLRecoverableException: Erreur d'E/S: Connection reset
Cause:
java.security.SecureRandom (#5 ) is a standard API provided by sun. Among various methods offered by this class void nextBytes(byte[]) is one. This method is used for generating random bytes. Oracle 11g JDBC drivers use this API to generate random number during login. Users using Linux have been encountering SQLException("Io exception: Connection reset").
The problem is two fold
- The JVM tries to list all the files in the /tmp (or alternate tmp directory set by -Djava.io.tmpdir) when SecureRandom.nextBytes(byte[]) is invoked. If the number of files is large the method takes a long time to respond and hence cause the server to timeout
- The method void nextBytes(byte[]) uses /dev/random on Linux and on some machines which lack the random number generating hardware the operation slows down to the extent of bringing the whole login process to a halt. Ultimately the the user encounters SQLException("Io exception: Connection reset")
Users upgrading to 11g can encounter this issue if the underlying OS is Linux which is running on a faulty hardware.
The cause of this has not yet been determined exactly. It could either be a problem in your hardware or the fact that for some reason the software cannot read from dev/random
Solution:
Change the setup for your application, so you add the next parameter to the java command:
-Djava.security.egd=file:/dev/./urandom
Or edit $JAVA_HOME/jre/lib/security/java.security and add the line : securerandom.source=file:/dev/./urandom
Why not securerandom.source=file/dev/urandom (#4)
Note the "/./" characters in the value. They are needed to work around known Oracle JRE bug #6202721.
See also JDK Enhancement Proposal 123. It is known that implementation of SecureRandom was improved in Java 8 onwards.
Sources:
1 comentários:
err connection reset
With the extensive use of the internet worldwide, we use different browsers to visit various web pages. Amidst this browsing, you might have come across the message that says “This Site Can’t Be Reached” or “The Connection Was Reset”. When Google Chrome or any other browser is redirected to some website, it could be due to several reasons. This “Connection Reset Error” creates trouble, causing interruption to work, thereby breaking our workflow. Sometimes by simply refreshing the page or restarting Chrome helps to overcome this Err_Connection_Reset error. But in certain cases, issues are not resolved and need to be worked out in-depth. Adopting some of these methods can be your saviour and allow you to work uninterruptedly.
Post a Comment