Skip to content

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

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
rafiss:fix-cancel-close-conn
Feb 14, 2022
Merged

sql/pgwire: close cancel request conn as soon as possible#76476
craig[bot] merged 1 commit intocockroachdb:masterfrom
rafiss:fix-cancel-close-conn

Conversation

@rafiss
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator Author

rafiss commented Feb 14, 2022

tftr!

bors r=otan

@craig
Copy link
Copy Markdown
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