forked from dork/tarantool-java
-
Notifications
You must be signed in to change notification settings - Fork 19
jdbc: connection may appear hang in case of connection issues #38
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
Comments
ztarvos
added a commit
to ztarvos/tarantool-java
that referenced
this issue
Oct 8, 2018
Added connection property 'socketTimeout' to allow user control over network timeout before actual connection is returned by the driver. Implemented 'Connection.setNetworkTimeout' API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. Fixed non-conforming methods to throw SQLException as per standard. Closes tarantool#38
ztarvos
added a commit
to ztarvos/tarantool-java
that referenced
this issue
Oct 12, 2018
Added connection property `socketTimeout` to allow user control over network timeout before actual connection is returned by the driver. This is only done for default socket provider. The default timeout is is left to be infinite. Implemented `Connection.setNetworkTimeout` API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. The connection that has timed out is forced to close. New subsequent operations requested on such connection must fail right away. The corresponding checks are embedded into relevant APIs. Closes tarantool#38
ztarvos
added a commit
to ztarvos/tarantool-java
that referenced
this issue
Nov 15, 2018
Added connection property `socketTimeout` to allow user control over network timeout before actual connection is returned by the driver. This is only done for default socket provider. The default timeout is left to be infinite. Implemented `Connection.setNetworkTimeout` API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. The connection that has timed out is forced to close. New subsequent operations requested on such connection must fail right away. The corresponding checks are embedded into relevant APIs. Closes tarantool#38
ztarvos
added a commit
to ztarvos/tarantool-java
that referenced
this issue
Dec 3, 2018
Added connection property `socketTimeout` to allow user control over network timeout before actual connection is returned by the driver. This is only done for default socket provider. The default timeout is left to be infinite. Implemented `Connection.setNetworkTimeout` API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. The connection that has timed out is forced to close. New subsequent operations requested on such connection must fail right away. The corresponding checks are embedded into relevant APIs. Closes tarantool#38
ztarvos
added a commit
to ztarvos/tarantool-java
that referenced
this issue
Dec 5, 2018
Added connection property `socketTimeout` to allow user control over network timeout before actual connection is returned by the driver. This is only done for default socket provider. The default timeout is left to be infinite. Implemented `Connection.setNetworkTimeout` API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. The connection that has timed out is forced to close. New subsequent operations requested on such connection must fail right away. The corresponding checks are embedded into relevant APIs. Closes tarantool#38
Totktonada
pushed a commit
that referenced
this issue
Dec 10, 2018
Added connection property `socketTimeout` to allow user control over network timeout before actual connection is returned by the driver. This is only done for default socket provider. The default timeout is left to be infinite. Implemented `Connection.setNetworkTimeout` API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. The connection that has timed out is forced to close. New subsequent operations requested on such connection must fail right away. The corresponding checks are embedded into relevant APIs. Closes #38
Pushed to connector-1.8.jdbc. The review and the discussion are here (the link is to the last message): https://www.freelists.org/post/tarantool-patches/PATCH-jdbc-add-connection-timeout-configuration-and-handling,5 |
Totktonada
pushed a commit
that referenced
this issue
Dec 11, 2018
Added connection property `socketTimeout` to allow user control over network timeout before actual connection is returned by the driver. This is only done for default socket provider. The default timeout is left to be infinite. Implemented `Connection.setNetworkTimeout` API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. The connection that has timed out is forced to close. New subsequent operations requested on such connection must fail right away. The corresponding checks are embedded into relevant APIs. Closes #38
Totktonada
pushed a commit
that referenced
this issue
Dec 11, 2018
Added connection property `socketTimeout` to allow user control over network timeout before actual connection is returned by the driver. This is only done for default socket provider. The default timeout is left to be infinite. Implemented `Connection.setNetworkTimeout` API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. The connection that has timed out is forced to close. New subsequent operations requested on such connection must fail right away. The corresponding checks are embedded into relevant APIs. Closes #38
Totktonada
pushed a commit
that referenced
this issue
Dec 11, 2018
Added connection property `socketTimeout` to allow user control over network timeout before actual connection is returned by the driver. This is only done for default socket provider. The default timeout is left to be infinite. Implemented `Connection.setNetworkTimeout` API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. The connection that has timed out is forced to close. New subsequent operations requested on such connection must fail right away. The corresponding checks are embedded into relevant APIs. Closes #38
Totktonada
pushed a commit
that referenced
this issue
Dec 12, 2018
Added connection property `socketTimeout` to allow user control over network timeout before actual connection is returned by the driver. This is only done for default socket provider. The default timeout is left to be infinite. Implemented `Connection.setNetworkTimeout` API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. The connection that has timed out is forced to close. New subsequent operations requested on such connection must fail right away. The corresponding checks are embedded into relevant APIs. Closes #38
Totktonada
pushed a commit
that referenced
this issue
Dec 12, 2018
Added connection property `socketTimeout` to allow user control over network timeout before actual connection is returned by the driver. This is only done for default socket provider. The default timeout is left to be infinite. Implemented `Connection.setNetworkTimeout` API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. The connection that has timed out is forced to close. New subsequent operations requested on such connection must fail right away. The corresponding checks are embedded into relevant APIs. Closes #38
Totktonada
pushed a commit
that referenced
this issue
Dec 12, 2018
Added connection property `socketTimeout` to allow user control over network timeout before actual connection is returned by the driver. This is only done for default socket provider. The default timeout is left to be infinite. Implemented `Connection.setNetworkTimeout` API to make it possible to change the maximum amount of time to wait for server replies after the connection is established. The connection that has timed out is forced to close. New subsequent operations requested on such connection must fail right away. The corresponding checks are embedded into relevant APIs. Closes #38
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried to use jdbc and the firewall was preventing the connection. The application seemed to hang.
Although, as I found out later, it actually was the effect of some OS-defined timeout,
it would be good to set meaningful timeout in the jdbc driver, especially when default socket provider is used.
Also, the exception thrown is not SQLException that one would expect from the jdbc driver.
Exception in thread "main" org.tarantool.CommunicationException: Couldn't connect to tarantool at org.tarantool.TarantoolBase.<init>(TarantoolBase.java:76) at org.tarantool.TarantoolConnection.<init>(TarantoolConnection.java:18) at org.tarantool.jdbc.SQLDriver$1.<init>(SQLDriver.java:51) at org.tarantool.jdbc.SQLDriver.connect(SQLDriver.java:51) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:270) at TestJdbc.main(TestJdbc.java:10) Caused by: java.io.EOFException at java.io.DataInputStream.readFully(DataInputStream.java:197) at java.io.DataInputStream.readFully(DataInputStream.java:169) at org.tarantool.TarantoolBase.<init>(TarantoolBase.java:45) ... 6 more
I propose:
The text was updated successfully, but these errors were encountered: