Repository navigation
Conversation
- Connector reset, which happens when the connector is returned to the pool (DISCARD ALL), now happens asynchronously - the user thread returns immediately, before the operation completes. Note that the IsValid() ping, which happens before returning a connector to the user, is still there. - Moved setting of ssl_renegotiation_limit to startup packet, was an additional roundtrip. This means that "DISCARD ALL" is sufficient to revert all params to their correct initial state. - Cleaned up an old pre-protocol3 flow Fixes npgsql#268
|
Sure! I'll have a look at it. While in the subject, I think we can start to think about removing the IsValid() ping. I think this is causing more trouble than helping. Or maybe make it optional. |
|
It's a good question about the ping. I haven't yet understood exactly how MSSQL handles this issue, will reread the discussion with you and @Emill. |
|
Mssql decided to not have any pings to avoid one round trip. They simply assume the socket will work. If not, an exception will be thrown when data is sent on the socket. I don't know what is the best... I would probably do some kind of periodic ping instead. |
|
I believe there are options in other providers to do pings that will help with high availability scenarios so that a failure is detected sooner. Josh |
|
I personally am for the ping, the idea of a user getting a connection from the pool, just to have it explode in their faces upon first use seems like a strange idea. The slowdown in getting a new connection from the pool doesn't seem like such a high price to pay, but I may be underestimating it. @Emill's idea to implement periodic polling is interesting, but it would add extra load (both at the client and at the backend), and if the connection is broken at any point after the last periodic ping we're back to the exploding connections scenario... |
e1d8c57 to
1f140e5
Compare
asynchronously - the user thread returns immediately, before the operation completes. Note that the
IsValid() ping, which happens before returning a connector to the user, is still there.
This means that "DISCARD ALL" is sufficient to revert all params to their correct initial state.
Fixes #268
@Emill, @franciscojunior, can you please take a look?