public inbox for [email protected]
help / color / mirror / Atom feedDriver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake
5+ messages / 2 participants
[nested] [flat]
* Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake
@ 2023-11-28 13:27 Martin Lichtin <[email protected]>
2023-11-28 14:07 ` Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Dave Cramer <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Martin Lichtin @ 2023-11-28 13:27 UTC (permalink / raw)
To: [email protected]
Hi
I'm seeing this thread hanging in the "getConnection" method, with no
timeout in sight.
However, the PGXADataSource is configured with a "connectTimeout" of 10
seconds.
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at
sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:464)
at
sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:165)
at sun.security.ssl.SSLTransport.decode(SSLTransport.java:109)
at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1392)
at
sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1300)
at
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:435)
at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:41)
at
org.postgresql.core.v3.ConnectionFactoryImpl.enableSSL(ConnectionFactoryImpl.java:571)
at
org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:168)
at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:223)
at org.postgresql.Driver.makeConnection(Driver.java:402)
at org.postgresql.Driver.connect(Driver.java:261)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at
org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:103)
at
org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:49)
at
org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:35)
Any reason this timeout is not being applied here?
The version in use here is 42.3.6
- Martin
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake
2023-11-28 13:27 Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Martin Lichtin <[email protected]>
@ 2023-11-28 14:07 ` Dave Cramer <[email protected]>
2023-11-28 20:28 ` Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Dave Cramer <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Dave Cramer @ 2023-11-28 14:07 UTC (permalink / raw)
To: Martin Lichtin <[email protected]>; +Cc: [email protected]
Hi Martin,
Thanks for the report. I'll have a look.
Dave Cramer
On Tue, 28 Nov 2023 at 08:27, Martin Lichtin <[email protected]> wrote:
> Hi
>
> I'm seeing this thread hanging in the "getConnection" method, with no
> timeout in sight.
> However, the PGXADataSource is configured with a "connectTimeout" of 10
> seconds.
>
> java.lang.Thread.State: RUNNABLE
> at java.net.SocketInputStream.socketRead0(Native Method)
> at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
> at java.net.SocketInputStream.read(SocketInputStream.java:171)
> at java.net.SocketInputStream.read(SocketInputStream.java:141)
> at
> sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:464)
> at
> sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:165)
> at sun.security.ssl.SSLTransport.decode(SSLTransport.java:109)
> at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1392)
> at
> sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1300)
> at
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:435)
> at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:41)
> at
> org.postgresql.core.v3.ConnectionFactoryImpl.enableSSL(ConnectionFactoryImpl.java:571)
> at
> org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:168)
> at
> org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
> at
> org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
> at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:223)
> at org.postgresql.Driver.makeConnection(Driver.java:402)
> at org.postgresql.Driver.connect(Driver.java:261)
> at java.sql.DriverManager.getConnection(DriverManager.java:664)
> at java.sql.DriverManager.getConnection(DriverManager.java:247)
> at
> org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:103)
> at
> org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:49)
> at
> org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:35)
>
> Any reason this timeout is not being applied here?
>
> The version in use here is 42.3.6
>
> - Martin
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake
2023-11-28 13:27 Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Martin Lichtin <[email protected]>
2023-11-28 14:07 ` Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Dave Cramer <[email protected]>
@ 2023-11-28 20:28 ` Dave Cramer <[email protected]>
2023-11-29 16:06 ` Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Martin Lichtin <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Dave Cramer @ 2023-11-28 20:28 UTC (permalink / raw)
To: Martin Lichtin <[email protected]>; +Cc: [email protected]
On Tue, 28 Nov 2023 at 09:07, Dave Cramer <[email protected]> wrote:
> Hi Martin,
>
> Thanks for the report. I'll have a look.
> Dave Cramer
>
>
> On Tue, 28 Nov 2023 at 08:27, Martin Lichtin <[email protected]> wrote:
>
>> Hi
>>
>> I'm seeing this thread hanging in the "getConnection" method, with no
>> timeout in sight.
>> However, the PGXADataSource is configured with a "connectTimeout" of 10
>> seconds.
>>
>> java.lang.Thread.State: RUNNABLE
>> at java.net.SocketInputStream.socketRead0(Native Method)
>> at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
>> at java.net.SocketInputStream.read(SocketInputStream.java:171)
>> at java.net.SocketInputStream.read(SocketInputStream.java:141)
>> at
>> sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:464)
>> at
>> sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:165)
>> at sun.security.ssl.SSLTransport.decode(SSLTransport.java:109)
>> at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1392)
>> at
>> sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1300)
>> at
>> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:435)
>> at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:41)
>> at
>> org.postgresql.core.v3.ConnectionFactoryImpl.enableSSL(ConnectionFactoryImpl.java:571)
>> at
>> org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:168)
>> at
>> org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
>> at
>> org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
>> at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:223)
>> at org.postgresql.Driver.makeConnection(Driver.java:402)
>> at org.postgresql.Driver.connect(Driver.java:261)
>> at java.sql.DriverManager.getConnection(DriverManager.java:664)
>> at java.sql.DriverManager.getConnection(DriverManager.java:247)
>> at
>> org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:103)
>> at
>> org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:49)
>> at
>> org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:35)
>>
>> Any reason this timeout is not being applied here?
>>
>> The version in use here is 42.3.6
>>
>
This Make sure to pass any network timeouts to the new SSL connection. by
davecramer · Pull Request #3040 · pgjdbc/pgjdbc (github.com)
<https://github.com/pgjdbc/pgjdbc/pull/3040; should fix the problem, can
you check ?
Dave
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake
2023-11-28 13:27 Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Martin Lichtin <[email protected]>
2023-11-28 14:07 ` Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Dave Cramer <[email protected]>
2023-11-28 20:28 ` Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Dave Cramer <[email protected]>
@ 2023-11-29 16:06 ` Martin Lichtin <[email protected]>
2023-11-29 16:12 ` Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Dave Cramer <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Martin Lichtin @ 2023-11-29 16:06 UTC (permalink / raw)
To: [email protected]
On 28/11/2023 21:28, Dave Cramer wrote:
> On Tue, 28 Nov 2023 at 09:07, Dave Cramer <[email protected]>
> wrote:
>
> Hi Martin,
>
> Thanks for the report. I'll have a look.
> Dave Cramer
>
> On Tue, 28 Nov 2023 at 08:27, Martin Lichtin <[email protected]>
> wrote:
>
> Hi
>
> I'm seeing this thread hanging in the "getConnection" method,
> with no timeout in sight.
> However, the PGXADataSource is configured with a
> "connectTimeout" of 10 seconds.
>
> java.lang.Thread.State: RUNNABLE
> at java.net.SocketInputStream.socketRead0(Native Method)
> at
> java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
> at java.net.SocketInputStream.read(SocketInputStream.java:171)
> at java.net.SocketInputStream.read(SocketInputStream.java:141)
> at
> sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:464)
> at
> sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:165)
> at sun.security.ssl.SSLTransport.decode(SSLTransport.java:109)
> at
> sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1392)
> at
> sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1300)
> at
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:435)
> at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:41)
> ...
> at
> java.sql.DriverManager.getConnection(DriverManager.java:247)
> at
> org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:103)
> at
> org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:49)
> at
> org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:35)
>
> Any reason this timeout is not being applied here?
>
> The version in use here is 42.3.6
>
>
> This Make sure to pass any network timeouts to the new SSL connection.
> by davecramer · Pull Request #3040 · pgjdbc/pgjdbc (github.com)
> <https://github.com/pgjdbc/pgjdbc/pull/3040> should fix the problem,
> can you check ?
Thanks! I'll try. Was hoping for a SNAPSHOT version with this change in,
but looks like these are no longer produced(?), although mentioned here
https://jdbc.postgresql.org/download/ Anyways, it will be quite hard to
reproduce this socket-read hang situation, so not sure I'll be able to
test the change :)
Some more observations (obv from a newcomer to this space..):
As mentioned I'm setting "connectTimeout". Is this value somehow
trickling down, and ending up at what's called "networkTimeout" in the code?
I'm asking as networkTimeout is not a connection parameter..
https://jdbc.postgresql.org/documentation/use/
Also confusing to me is the existing parameter "sslResponseTimeout",
this defaults to 5 seconds, and is already documented as 'the maximum
time to wait for a response after requesting an SSL encrypted connection
from the server'. Shouldn't this value be used in above case.
Lastly, seeing "socketTimeout", however I would not want to set this
one, as it could interfere with long-running queries, and to me, should
not be used during connection setup.
- Martin
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake
2023-11-28 13:27 Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Martin Lichtin <[email protected]>
2023-11-28 14:07 ` Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Dave Cramer <[email protected]>
2023-11-28 20:28 ` Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Dave Cramer <[email protected]>
2023-11-29 16:06 ` Re: Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Martin Lichtin <[email protected]>
@ 2023-11-29 16:12 ` Dave Cramer <[email protected]>
0 siblings, 0 replies; 5+ messages in thread
From: Dave Cramer @ 2023-11-29 16:12 UTC (permalink / raw)
To: Martin Lichtin <[email protected]>; +Cc: [email protected]
On Wed, 29 Nov 2023 at 11:06, Martin Lichtin <[email protected]> wrote:
>
> On 28/11/2023 21:28, Dave Cramer wrote:
>
> On Tue, 28 Nov 2023 at 09:07, Dave Cramer <[email protected]>
> <[email protected]> wrote:
>
>> Hi Martin,
>>
>> Thanks for the report. I'll have a look.
>> Dave Cramer
>>
>> On Tue, 28 Nov 2023 at 08:27, Martin Lichtin <[email protected]> wrote:
>>
>>> Hi
>>>
>>> I'm seeing this thread hanging in the "getConnection" method, with no
>>> timeout in sight.
>>> However, the PGXADataSource is configured with a "connectTimeout" of 10
>>> seconds.
>>>
>>> java.lang.Thread.State: RUNNABLE
>>> at java.net.SocketInputStream.socketRead0(Native Method)
>>> at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
>>> at java.net.SocketInputStream.read(SocketInputStream.java:171)
>>> at java.net.SocketInputStream.read(SocketInputStream.java:141)
>>> at
>>> sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:464)
>>> at
>>> sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:165)
>>> at sun.security.ssl.SSLTransport.decode(SSLTransport.java:109)
>>> at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1392)
>>> at
>>> sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1300)
>>> at
>>> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:435)
>>> at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:41)
>>> ...
>>> at java.sql.DriverManager.getConnection(DriverManager.java:247)
>>> at
>>> org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:103)
>>> at
>>> org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:49)
>>> at
>>> org.postgresql.xa.PGXADataSource.getXAConnection(PGXADataSource.java:35)
>>>
>>> Any reason this timeout is not being applied here?
>>>
>>> The version in use here is 42.3.6
>>>
>>
> This Make sure to pass any network timeouts to the new SSL connection. by
> davecramer · Pull Request #3040 · pgjdbc/pgjdbc (github.com)
> <https://github.com/pgjdbc/pgjdbc/pull/3040; should fix the problem, can
> you check ?
>
> Thanks! I'll try. Was hoping for a SNAPSHOT version with this change in,
> but looks like these are no longer produced(?), although mentioned here
> https://jdbc.postgresql.org/download/ Anyways, it will be quite hard to
> reproduce this socket-read hang situation, so not sure I'll be able to test
> the change :)
>
In order to create a snapshot version I would need to merge the change in.
> Some more observations (obv from a newcomer to this space..):
>
> As mentioned I'm setting "connectTimeout". Is this value somehow trickling
> down, and ending up at what's called "networkTimeout" in the code?
> I'm asking as networkTimeout is not a connection parameter..
> https://jdbc.postgresql.org/documentation/use/
>
> Also confusing to me is the existing parameter "sslResponseTimeout", this
> defaults to 5 seconds, and is already documented as 'the maximum time to
> wait for a response after requesting an SSL encrypted connection from the
> server'. Shouldn't this value be used in above case.
>
Fair question
> Lastly, seeing "socketTimeout", however I would not want to set this one,
> as it could interfere with long-running queries, and to me, should not be
> used during connection setup.
>
Should probably reset it after connecting.
Thanks,
Dave
> - Martin
>
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2023-11-29 16:12 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-11-28 13:27 Driver hangs in connect->MakeSSL.convert->SSLSocketImpl.startHandshake Martin Lichtin <[email protected]>
2023-11-28 14:07 ` Dave Cramer <[email protected]>
2023-11-28 20:28 ` Dave Cramer <[email protected]>
2023-11-29 16:06 ` Martin Lichtin <[email protected]>
2023-11-29 16:12 ` Dave Cramer <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox