Skip to content

[v10] Connect: Fix premature proxyClient.Close() when getting db users#14375

Merged
ravicious merged 2 commits intobranch/v10from
bot/backport-14230-branch/v10
Jul 12, 2022
Merged

[v10] Connect: Fix premature proxyClient.Close() when getting db users#14375
ravicious merged 2 commits intobranch/v10from
bot/backport-14230-branch/v10

Conversation

@ravicious
Copy link
Copy Markdown
Member

Backport #14230 to branch/v10

In the previous version, the proxy client would be closed immediately
after addMetadataToRetryableError. This commit makes it so that the proxy
client is closed only after GetAllowedDatabaseUsers finishes.

When running Connect on Windows, Grzegorz ran into a problem where fetching
db users for MSSQL would fail but only on Windows and only for MSSQL:

    Failed to fetch current user information: connection error:
    desc = "transport: Error while dialing failed to dial: read tcp
    10.211.55.4:55519->52.14.45.73:3023: use of closed network
    connection". services\role.go:764

Other times the error would be

    connection error: desc = "transport: Error while dialing failed
    to dial: ssh: unexpected packet in response to channel open:
    <nil>"] apiserver\middleware.go:39

Surprisingly, `tsh db ls` didn't have this problem. So when thinking about
what we're doing differently than tsh and how it might be related to
a closed connection, I noticed that I made a bug in the code that closes
the proxy client.
@ravicious ravicious marked this pull request as ready for review July 12, 2022 15:16
@ravicious ravicious enabled auto-merge (squash) July 12, 2022 15:16
@github-actions github-actions Bot removed the request for review from zmb3 July 12, 2022 16:46
@ravicious ravicious merged commit 8264e3c into branch/v10 Jul 12, 2022
@ravicious ravicious deleted the bot/backport-14230-branch/v10 branch July 12, 2022 17:03
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.

4 participants