[pgjdbc/pgjdbc] 194411: fix: Connection leak in ConnectionFactoryImpl#tryC...

From: Michał Wyrzykowski <noreply(at)github(dot)com>
To: pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: [pgjdbc/pgjdbc] 194411: fix: Connection leak in ConnectionFactoryImpl#tryC...
Date: 2021-11-24 17:04:49
Message-ID: pgjdbc/pgjdbc/push/refs/heads/master/64ac1d-194411@github.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: 194411ab82c495d0a7997d0f9831c36c63b6bcb4
https://github.com/pgjdbc/pgjdbc/commit/194411ab82c495d0a7997d0f9831c36c63b6bcb4
Author: Michał Wyrzykowski <w(dot)michal1(at)gmail(dot)com>
Date: 2021-11-24 (Wed, 24 Nov 2021)

Changed paths:
M pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java

Log Message:
-----------
fix: Connection leak in ConnectionFactoryImpl#tryConnect #2350 (#2351)

When `ConnectionFactoryImpl#tryConnect` fails with an exception,
a newly created PGStream is left without closing it. The finalizer
handles the close, so it's not a problem most of the time.
But Finalizer has no guarantees on the time when it'll close
the resource. The resource may hang open for a longer period.

After the change PGStream is closed just before losing the reference.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Sergey Nuyanzin 2021-11-26 10:52:07 [pgjdbc/pgjdbc] 9899c6: Misprint in messages_ru.java (#2358)
Previous Message JoelRabinovitch 2021-11-19 00:04:10 [pgjdbc/pgjdbc] 64ac1d: fixForIsAutoGenerated Fix For IS_AUTOGENERATED Fla...