8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd7b7c1 commit 769f569Copy full SHA for 769f569
src/main/java/com/github/pgasync/impl/PgConnectionPool.java
@@ -169,6 +169,7 @@ public Observable<Connection> getConnection() {
169
170
new PgConnection(openStream(address), dataConverter)
171
.connect(username, password, database)
172
+ .doOnError(__ -> release(null))
173
.subscribe(subscriber);
174
} finally {
175
if (locked) {
@@ -200,7 +201,7 @@ private void releaseIfNotPipelining(Connection connection) {
200
201
202
@Override
203
public void release(Connection connection) {
- boolean failed = !((PgConnection) connection).isConnected();
204
+ boolean failed = connection == null || !((PgConnection) connection).isConnected();
205
206
Subscriber<? super Connection> next;
207
lock.lock();
0 commit comments