postgres-async-driver icon indicating copy to clipboard operation
postgres-async-driver copied to clipboard

Connecting to server waited endlessly

Open chang-chao opened this issue 8 years ago • 2 comments

I'm running com.github.pgasync.impl.AuthenticationTest.shouldThrowExceptionOnInvalidCredentials() junit test on the master,with minor changes of the host to a remote server (posgresql 8.4) in my LAN . and the test freezes waiting for something.

Please see the attached packet capture.

capture.zip

chang-chao avatar Apr 22 '16 10:04 chang-chao

It seemes that it has something to do with the implementation of com.github.pgasync.impl.DatabaseRule.createPoolBuilder(int),which set the ssl property to true.When ssl is set to false,the test passed.

chang-chao avatar Apr 22 '16 13:04 chang-chao

This is output of pg_config,which says that when postgresql is compiled,ssl is not enabled. Which means that postgres is compiled without the ssl enabled but ssl property of ConnectionPoolBuilder is set to true in the client by mistake,connecting to db can last for a long time without any error.

C:\Program Files\PostgreSQL\9.4\bin>pg_config.exe
BINDIR = C:/PROGRA~1/POSTGR~1/9.4/bin
DOCDIR = C:/PROGRA~1/POSTGR~1/9.4/doc
HTMLDIR = C:/PROGRA~1/POSTGR~1/9.4/doc
INCLUDEDIR = C:/PROGRA~1/POSTGR~1/9.4/include
PKGINCLUDEDIR = C:/PROGRA~1/POSTGR~1/9.4/include
INCLUDEDIR-SERVER = C:/PROGRA~1/POSTGR~1/9.4/include/server
LIBDIR = C:/PROGRA~1/POSTGR~1/9.4/lib
PKGLIBDIR = C:/PROGRA~1/POSTGR~1/9.4/lib
LOCALEDIR = C:/PROGRA~1/POSTGR~1/9.4/share/locale
MANDIR = C:/Program Files/PostgreSQL/9.4/man
SHAREDIR = C:/PROGRA~1/POSTGR~1/9.4/share
SYSCONFDIR = C:/Program Files/PostgreSQL/9.4/etc
PGXS = C:/Program Files/PostgreSQL/9.4/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = --enable-thread-safety --enable-integer-datetimes --enable-nls --with-ldap --with-ossp-uuid --with-libxml --with-libxslt --with-tcl --with-perl --with-python
VERSION = PostgreSQL 9.4.5

chang-chao avatar Apr 22 '16 14:04 chang-chao