-
Notifications
You must be signed in to change notification settings - Fork 108
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
SSL connection problem #168
Comments
I can also reproduce the problem when getting a connection with SSL mode Class.forName("com.impossibl.postgres.jdbc.PGDriver");
String url = "jdbc:pgsql://host.example/test?ssl.mode=Require";
Connection conn = DriverManager.getConnection(url, "test", "..."); This produces this exception (most of the time):
This is caused by the call to
This is almost certainly due to a race condition regarding when A slight delay in
(This is obviously not the correct way to fix this, but this seems to confirm the cause of the problem.) |
I should add that I haven't been able to reproduce the problem when the client is running on a Linux machine, but I'm able to reproduce it regularly from a Windows machine. Both were running the latest Oracle Java 8 release. |
I'm running the client from an Android emulator, thus it seems that only linux machines are supported... |
@normanmaurer is @harbulot issue/solution a Netty problem or are we initializing it incorrectly? |
@harbulot Did you report this to the Netty project ? |
Let me check if there is a bug in netty |
@jesperpedersen @harbulot @kdubb it is a netty bug... Let me fix it there |
@normanmaurer Thanks ! |
Motivation: If the handlerAdded(...) callback was not called, the checkDeadLock() of the handshakeFuture will produce an IllegalStateException. This was first reported at impossibl/pgjdbc-ng#168 . Modifications: Pass deadlock check if ctx is null Result: No more race and so IllegalStateException.
Motivation: If the handlerAdded(...) callback was not called, the checkDeadLock() of the handshakeFuture will produce an IllegalStateException. This was first reported at impossibl/pgjdbc-ng#168 . Modifications: Pass deadlock check if ctx is null Result: No more race and so IllegalStateException.
Motivation: If the handlerAdded(...) callback was not called, the checkDeadLock() of the handshakeFuture will produce an IllegalStateException. This was first reported at impossibl/pgjdbc-ng#168 . Modifications: Pass deadlock check if ctx is null Result: No more race and so IllegalStateException.
Motivation: If the handlerAdded(...) callback was not called, the checkDeadLock() of the handshakeFuture will produce an IllegalStateException. This was first reported at impossibl/pgjdbc-ng#168 . Modifications: Pass deadlock check if ctx is null Result: No more race and so IllegalStateException.
Fixed netty/netty#3868. Will be part of netty 4.0.29.Final |
Fixed by upgrade to Netty |
Motivation: If the handlerAdded(...) callback was not called, the checkDeadLock() of the handshakeFuture will produce an IllegalStateException. This was first reported at impossibl/pgjdbc-ng#168 . Modifications: Pass deadlock check if ctx is null Result: No more race and so IllegalStateException.
Hello,
I'm facing big problem while trying to connect to a DB using SSL and your library...
I've tried many connection strings, but none works.
Do you know what can I do? In fact, I'm getting this exception:
java.sql.SQLException: Connection Error: java.lang.IllegalStateException at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:189) at com.impossibl.postgres.jdbc.PGDriver.connect(PGDriver.java:77) at com.impossibl.postgres.jdbc.PGDriver.connect(PGDriver.java:52) at java.sql.DriverManager.getConnection(DriverManager.java:179) at it.polito.mobile.testpostgres.MainActivity$1.doInBackground(MainActivity.java:60) at it.polito.mobile.testpostgres.MainActivity$1.doInBackground(MainActivity.java:35) at android.os.AsyncTask$2.call(AsyncTask.java:288) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.io.IOException: java.lang.IllegalStateException at com.impossibl.postgres.protocol.v30.ProtocolFactoryImpl.translateConnectionException(ProtocolFactoryImpl.java:285) at com.impossibl.postgres.protocol.v30.ProtocolFactoryImpl.connect(ProtocolFactoryImpl.java:199) at com.impossibl.postgres.protocol.v30.ProtocolFactoryImpl.connect(ProtocolFactoryImpl.java:90) at com.impossibl.postgres.system.BasicContext.<init>(BasicContext.java:130) at com.impossibl.postgres.jdbc.PGConnectionImpl.<init>(PGConnectionImpl.java:185) at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:180) ... 11 more Caused by: java.lang.IllegalStateException at io.netty.handler.ssl.SslHandler$LazyChannelPromise.executor(SslHandler.java:1491) at io.netty.util.concurrent.DefaultPromise.checkDeadLock(DefaultPromise.java:388) at io.netty.util.concurrent.DefaultPromise.awaitUninterruptibly(DefaultPromise.java:283) at io.netty.util.concurrent.DefaultPromise.syncUninterruptibly(DefaultPromise.java:225) at io.netty.util.concurrent.DefaultPromise.syncUninterruptibly(DefaultPromise.java:32) at com.impossibl.postgres.protocol.v30.ProtocolFactoryImpl.connect(ProtocolFactoryImpl.java:132) ... 15 more
The text was updated successfully, but these errors were encountered: