Skip to content

pgwire: ensure the conn is always closed even in tests#47700

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20200420-pgwire
Apr 20, 2020
Merged

pgwire: ensure the conn is always closed even in tests#47700
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20200420-pgwire

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Apr 20, 2020

Fixes #46252

Fixes a regression introduced in #45193.

Release note: None

Fixes a regression introduced in cockroachdb#45193.

Release note: None
@knz knz requested a review from tbg April 20, 2020 16:03
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the quick fix! How did the test get flaky as a result of this?

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Apr 20, 2020

LGTM, thanks for the quick fix! How did the test get flaky as a result of this?

The code is intending to do conn.Close() server-side, whereby the client gets a RST and closes its SQL conn cleanly.

Without this server-side close, when the test shuts down, the server-side conn is still open. Then the client initiates the conn teardown and sends a packet to the server, but because the server is shutting down it does not respond and the client gets a timeout.

The reason why it's flaky is that most of the times the client is able to send its shutdown request to the test server and get a response before the server is so far in the shutdown that it doesn't respond any more.

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Apr 20, 2020

bors r=tbg

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 20, 2020

Build succeeded

@craig craig bot merged commit 0d008bd into cockroachdb:master Apr 20, 2020
@knz knz deleted the 20200420-pgwire branch April 21, 2020 08:25
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.

sql/pgwire: TestConn failed

3 participants