Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle JDBC issue on Linux - IO Error: Connection reset #1077

Closed
KevinSheedy opened this issue Aug 11, 2015 · 6 comments
Closed

Oracle JDBC issue on Linux - IO Error: Connection reset #1077

KevinSheedy opened this issue Aug 11, 2015 · 6 comments

Comments

@KevinSheedy
Copy link

The Oracle JDBC driver has a known issue on some linux systems. When using flyway, it manifests itself as an intermittent failure with the message:

ERROR: Unable to obtain Jdbc connection from DataSource .... IO Error: Connection reset

The problem can be fixed by starting Java with the following JVM param:

-Djava.security.egd=file:/dev/../dev/urandom

To fix it on my system, I replaced this line in the flyway script:

"$JAVA_CMD" -cp "$CP" org.flywaydb.commandline.Main "$@"

With this one:

"$JAVA_CMD" -Djava.security.egd=file:/dev/../dev/urandom -cp "$CP" org.flywaydb.commandline.Main "$@"

Do you think it would be worth adding a feature to flyway to allow JVM params to be passed in as a setting, without having to modify the original flyway file?

@ThomasRasmussen
Copy link

I ran into problems with Connection Reset towards Oracle, and this option actually makes a big difference... My builds actually runs in less than 5 seconds where it would often fail after the first call to flyway.

Ie. if I did a flyway:info this would run OK once, but then the following flyway runs will fail with connection reset... Connecting to Oracle with ie. SQLDeveloper works fine, so it is not a DB issue.

Apparently it is an issue in Java: http://stackoverflow.com/questions/137212/how-to-solve-performance-problem-with-java-securerandom

@davidkarlsen
Copy link

Yes. The entropy problem exists on Linux. Which os are you running on?
17. sep. 2015 8:00 a.m. skrev "Thomas Rasmussen" notifications@github.com:

I ran into problems with Connection Reset towards Oracle, and this option
actually makes a big difference... My builds actually runs in less than 5
seconds where it would often fail after the first call to flyway.

Ie. if I did a flyway:info this would run OK once, but then the following
flyway runs will fail with connection reset... Connecting to Oracle with
ie. SQLDeveloper works fine, so it is not a DB issue.

Apparently it is an issue in Java:
http://stackoverflow.com/questions/137212/how-to-solve-performance-problem-with-java-securerandom


Reply to this email directly or view it on GitHub
#1077 (comment).

@ThomasRasmussen
Copy link

I'm running on Ubuntu 14.04 LTS running on VMWare.

I found a nice explanation here: http://www.usn-it.de/index.php/2009/02/20/oracle-11g-jdbc-driver-hangs-blocked-by-devrandom-entropy-pool-empty/

It would be nice to have this option inside flyway property file or something instead ;-)

@davidkarlsen
Copy link

There you go. I recommend installing the package haveged which fills dev
random
17. sep. 2015 9:44 a.m. skrev "Thomas Rasmussen" notifications@github.com:

I'm running on Ubuntu 14.04 LTS running on VMWare.

I found a nice explanation here:
http://www.usn-it.de/index.php/2009/02/20/oracle-11g-jdbc-driver-hangs-blocked-by-devrandom-entropy-pool-empty/

It would be nice to have this option inside flyway property file or
something instead ;-)


Reply to this email directly or view it on GitHub
#1077 (comment).

@axelfontaine
Copy link
Contributor

Fixed.

@forestlcoder
Copy link

when I use more than 2 connections to get Oracle data by Flink JDBCInputFormatBuilder, it will throw Connection reset exception. I add -Djava.security.egd=file:/dev/../dev/urandom in my JVM params like this
java -XX:+UseG1GC -Xms60000M -Xmx60000M -XX:MaxDirectMemorySize=8388607T -Djava.security.egd=file:/dev/../urandom -Dlog.file=/data/flink/log/flink-sctele-taskmanager-4-ELK2.tianyiHD.log -Dlog4j.configuration=file:/usr/local/flink-1.4.2/conf/log4j.properties -Dlogback.configurationFile=file:/usr/local/flink-1.4.2/conf/logback.xml -classpath /usr/local/flink-1.4.2/lib/flink-python_2.11-1.4.2.jar:/usr/local/flink-1.4.2/lib/flink-shaded-hadoop2-uber-1.4.2.jar:/usr/local/flink-1.4.2/lib/log4j-1.2.17.jar:/usr/local/flink-1.4.2/lib/slf4j-log4j12-1.7.7.jar:/usr/local/flink-1.4.2/lib/flink-dist_2.11-1.4.2.jar::: org.apache.flink.runtime.taskmanager.TaskManager --configDir /usr/local/flink-1.4.2/conf
but it still don`t work for me.

@flyway flyway locked as resolved and limited conversation to collaborators Aug 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants