Skip to content

Mark protocol state in Error when out of sync detected#668

Merged
levkk merged 1 commit intopgdogdev:mainfrom
jbielick:error-conn-on-out-of-sync
Dec 15, 2025
Merged

Mark protocol state in Error when out of sync detected#668
levkk merged 1 commit intopgdogdev:mainfrom
jbielick:error-conn-on-out-of-sync

Conversation

@jbielick
Copy link
Copy Markdown
Contributor

Purpose

This addresses some side effects of #565 in that when a connection falls out of sync (due to currently unknown series of events), the connection is detected as out of sync, but is checked back into the pool without any corrective action.

Approach

This updates server.rs to set its stats state to State::Error when we encounter a ProtocolOutOfSync error while reading from the server and decided whether to forward the message to the client. The result is that the connection will be disconnected when attempted to be checked back into the pool and the tainted connection will not be re-used.

This addresses some side effects of 565 in that when a connection falls
out of sync (due to currently unknown series of events), the connection
is detected as out of sync, but is checked back into the pool without
any corrective action.

This updates server.rs to set its stats state to State::Error when we
encounter a ProtocolOutOfSync error while reading from the server and
decided whether to forward the message to the client. The result is that
the connection will be disconnected when attempted to be checked back
into the pool and the tainted connection will not be re-used.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 10, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Collaborator

@levkk levkk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thank you so much. Happy to merge this in if you'd be willing to accept the CLA. Cheers!

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 93.75000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pgdog/src/backend/server.rs 93.10% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jbielick
Copy link
Copy Markdown
Contributor Author

if you'd be willing to accept the CLA. Cheers!

Working on approval for that. Will follow up as soon as I get it!

@jbielick
Copy link
Copy Markdown
Contributor Author

@levkk All set!

@levkk levkk merged commit 487cceb into pgdogdev:main Dec 15, 2025
8 checks passed
dev-lew pushed a commit to dev-lew/pgdog that referenced this pull request Feb 18, 2026
## Purpose

This addresses some side effects of pgdogdev#565 in that when a connection falls
out of sync (due to currently unknown series of events), the connection
is detected as out of sync, but is checked back into the pool without
any corrective action.

## Approach

This updates server.rs to set its stats state to State::Error when we
encounter a ProtocolOutOfSync error while reading from the server and
decided whether to forward the message to the client. The result is that
the connection will be disconnected when attempted to be checked back
into the pool and the tainted connection will not be re-used.
@levkk
Copy link
Copy Markdown
Collaborator

levkk commented Apr 10, 2026

Finally found the root cause for this. Fix in #887

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

Successfully merging this pull request may close these issues.

3 participants