Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading ERROR before connection reset #63

Open
x4m opened this issue Jan 28, 2021 · 3 comments
Open

Reading ERROR before connection reset #63

x4m opened this issue Jan 28, 2021 · 3 comments

Comments

@x4m
Copy link
Contributor

x4m commented Jan 28, 2021

Hi!

When someone is using a connection pooler like Odyssey or PgBouncer they might want to enable pool_timeout (Odyssey) or query_wait_timeout(Bouncer) feature. In this case, the client waiting for some time for a free server connection might get ErrorResponse from the pooler followed by client disconnection.
Odyssey user will get "read tcp [2a02:6b8:0:2807:70d5:dc6a:5f2c:3882]:50336->[2a02:6b8:c1e:222f:0:1589:7844:129b]:6432: read: connection reset by peer". PgBouncer users will get simply "Unexpected EOF".

I think pooler has no change to pretend that Be\Fe sync persists. If we can fix this on the pooler side I'd be happy to do so.

Can we make receiveMessage() return the first ErrorResponse it encounters even if MRR is not closed yet, but the connection is broken?

Many thanks for maintaining such useful lib!

@jackc
Copy link
Owner

jackc commented Jan 30, 2021

I'm not sure I understand the issue.

The pooler sends an error and then closes the the connection? What level of error is it? I would expect it to be FATAL and that should be handled propoerly.

Also, I'm not sure I understand what you want the client to do differently.

@x4m
Copy link
Contributor Author

x4m commented Jan 31, 2021

OK, I'll try to fix it on poolers' side.
yandex/odyssey#271
pgbouncer/pgbouncer#564

If disconnection is preceded by any error, driver could save this error to show to user. See #64

@x4m
Copy link
Contributor Author

x4m commented Jan 10, 2022

The fix was merged to both poolers. But I still think It may make sense to prefer to return Postgres error over network error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants