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

sql/pgwire: close cancel request conn as soon as possible #76476

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Feb 12, 2022

fixes #76231

Rather than closing in the defer block, do it sooner. This is because
some clients (e.g. PGJDBC) rely on timeout behavior where the connection
is closed as soon as the request data is read.

Release note: None

Rather than closing in the defer block, do it sooner. This is because
some clients (e.g. PGJDBC rely on timeout behavior where the connection
is closed as soon as the request data is read.

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rafiss rafiss requested a review from a team February 13, 2022 20:06
// entirely new connection that's created just to send the cancel. We close
// the connection as soon as possible after reading the data, since there
// is nothing to send back to the client.
_ = conn.Close()
Copy link
Contributor

Choose a reason for hiding this comment

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

it may be worth logging this error somewhere just in case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hm, i'd prefer not to. the client is also allowed to close the conn first. even apart from that i don't feel that it's that actionable if this errors out

@rafiss
Copy link
Collaborator Author

rafiss commented Feb 14, 2022

tftr!

bors r=otan

@craig
Copy link
Contributor

craig bot commented Feb 14, 2022

Build succeeded:

@craig craig bot merged commit bbb473c into cockroachdb:master Feb 14, 2022
@rafiss rafiss deleted the fix-cancel-close-conn branch February 14, 2022 19:51
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.

roachtest: pgjdbc failed
3 participants