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

chore: Detect client disconnect in pg proxy #2256

Merged
merged 3 commits into from
Dec 14, 2023
Merged

Conversation

scsmithr
Copy link
Member

@scsmithr scsmithr commented Dec 14, 2023

  • Lowers log level for unexpected eof errors (client disconnects).
  • Raises log level for all other errors

Closes #2255

- Lowers log level for unexpected eof errors (client disconnects).
- Raises log level for all other errors
@greyscaled
Copy link
Contributor

can we mark this as closing the issue #2255 ?

@scsmithr scsmithr enabled auto-merge (squash) December 14, 2023 19:53
@scsmithr
Copy link
Member Author

can we mark this as closing the issue #2255 ?

done

@@ -85,7 +87,9 @@ impl PgProxy {
debug!("client connected (proxy)");
match handler.proxy_connection(inbound).await {
Ok(_) => debug!("client disconnected"),
Err(e) => debug!(%e, "client disconnected with error."),
Err(PgSrvError::Io(e)) if e.kind() == io::ErrorKind::UnexpectedEof =>
trace!("client disconnected"),
Copy link
Contributor

Choose a reason for hiding this comment

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

should the Ok() case also be a trace then? should we distinguish between the two?

Copy link
Member Author

Choose a reason for hiding this comment

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

will add

Copy link
Member Author

Choose a reason for hiding this comment

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

Downgraded debugs to trace, and used different messages in both cases (in case we need to distinguish).

@scsmithr scsmithr disabled auto-merge December 14, 2023 20:03
@scsmithr scsmithr enabled auto-merge (squash) December 14, 2023 20:22
@scsmithr scsmithr merged commit 6187293 into main Dec 14, 2023
10 checks passed
@scsmithr scsmithr deleted the sean/trace-disconnect branch December 14, 2023 20:31
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.

pg proxy: client-side socket close detection
3 participants