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

Provide proxy listener mode from reversetunnel.Resolver #16434

Merged
merged 3 commits into from
Sep 26, 2022

Conversation

rosstimothy
Copy link
Contributor

By only providing the tunnel address from the reversetunnel.Resolver callers would still need to lookup the proxy listener mode to determine how to dial the address. This results in sending a request to /webapi/find once by the resolver to get the tunnel address and then a second request to /webapi/find by users of the Resolver to determine the proxy listener mode. Propagating the listener mode along with the tunnel address by the Resolver ensures only one /webapi/find call is needed.

This is especially impactful because the reversetunnel.TunnelAuthDialer which is used by the auth http client would do this everytime the http.Client connection pool was empty. When the http.Client needed to dial the auth server it was incurring the additional roundtrip to the proxy.

@rosstimothy
Copy link
Contributor Author

rosstimothy commented Sep 15, 2022

Trace capturing sending two webapi/Find requests as a result of the auth http client sending a request without any active connection in its pool:
image
Note: the webclient/Ping span was a copy/paste error and it should have been webclient/GetTunnelAddr

@rosstimothy rosstimothy force-pushed the tross/tunnel_addr branch 3 times, most recently from c1abcbb to 5b5b7b9 Compare September 15, 2022 13:46
@rosstimothy rosstimothy marked this pull request as ready for review September 15, 2022 14:10
@github-actions github-actions bot requested review from lxea and zmb3 September 15, 2022 14:10
By only providing the tunnel address from the `reversetunnel.Resolver`
callers would still need to lookup the proxy listener mode to determine
how to dial the address. This results in sending a request to
`/webapi/find` once by the resolver to get the tunnel address and then
a second request to `/webapi/find` by users of the `Resolver` to determine
the proxy listener mode. Propagating the listener mode along with the
tunnel address by the `Resolver` ensures only one `/webapi/find` call
is needed.

This is especially impactful because the `reversetunnel.TunnelAuthDialer`
which is used by the auth http client would do this everytime the
`http.Client` connection pool was empty. When the `http.Client` needed
to dial the auth server it was incurring the additional roundtrip to the
proxy.
@rosstimothy
Copy link
Contributor Author

friendly ping @lxea @zmb3

Copy link
Contributor

@lxea lxea left a comment

Choose a reason for hiding this comment

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

This LGTM, there are a few CodeQL vulnerability errors, do these matter at all?

@rosstimothy
Copy link
Contributor Author

This LGTM, there are a few CodeQL vulnerability errors, do these matter at all?

They seem to be coming from code that existed prior to this change. I'm inclined not to remedy them in this PR.

@rosstimothy rosstimothy enabled auto-merge (squash) September 26, 2022 19:54
@rosstimothy rosstimothy merged commit 0ec2116 into master Sep 26, 2022
rosstimothy added a commit that referenced this pull request Oct 25, 2022
By only providing the tunnel address from the `reversetunnel.Resolver`
callers would still need to lookup the proxy listener mode to determine
how to dial the address. This results in sending a request to
`/webapi/find` once by the resolver to get the tunnel address and then
a second request to `/webapi/find` by users of the `Resolver` to determine
the proxy listener mode. Propagating the listener mode along with the
tunnel address by the `Resolver` ensures only one `/webapi/find` call
is needed.

This is especially impactful because the `reversetunnel.TunnelAuthDialer`
which is used by the auth http client would do this everytime the
`http.Client` connection pool was empty. When the `http.Client` needed
to dial the auth server it was incurring the additional roundtrip to the
proxy.
rosstimothy added a commit that referenced this pull request Oct 25, 2022
By only providing the tunnel address from the `reversetunnel.Resolver`
callers would still need to lookup the proxy listener mode to determine
how to dial the address. This results in sending a request to
`/webapi/find` once by the resolver to get the tunnel address and then
a second request to `/webapi/find` by users of the `Resolver` to determine
the proxy listener mode. Propagating the listener mode along with the
tunnel address by the `Resolver` ensures only one `/webapi/find` call
is needed.

This is especially impactful because the `reversetunnel.TunnelAuthDialer`
which is used by the auth http client would do this everytime the
`http.Client` connection pool was empty. When the `http.Client` needed
to dial the auth server it was incurring the additional roundtrip to the
proxy.
rosstimothy added a commit that referenced this pull request Oct 25, 2022
By only providing the tunnel address from the `reversetunnel.Resolver`
callers would still need to lookup the proxy listener mode to determine
how to dial the address. This results in sending a request to
`/webapi/find` once by the resolver to get the tunnel address and then
a second request to `/webapi/find` by users of the `Resolver` to determine
the proxy listener mode. Propagating the listener mode along with the
tunnel address by the `Resolver` ensures only one `/webapi/find` call
is needed.

This is especially impactful because the `reversetunnel.TunnelAuthDialer`
which is used by the auth http client would do this everytime the
`http.Client` connection pool was empty. When the `http.Client` needed
to dial the auth server it was incurring the additional roundtrip to the
proxy.
rosstimothy added a commit that referenced this pull request Oct 25, 2022
By only providing the tunnel address from the `reversetunnel.Resolver`
callers would still need to lookup the proxy listener mode to determine
how to dial the address. This results in sending a request to
`/webapi/find` once by the resolver to get the tunnel address and then
a second request to `/webapi/find` by users of the `Resolver` to determine
the proxy listener mode. Propagating the listener mode along with the
tunnel address by the `Resolver` ensures only one `/webapi/find` call
is needed.

This is especially impactful because the `reversetunnel.TunnelAuthDialer`
which is used by the auth http client would do this everytime the
`http.Client` connection pool was empty. When the `http.Client` needed
to dial the auth server it was incurring the additional roundtrip to the
proxy.
rosstimothy added a commit that referenced this pull request Nov 2, 2022
)

By only providing the tunnel address from the `reversetunnel.Resolver`
callers would still need to lookup the proxy listener mode to determine
how to dial the address. This results in sending a request to
`/webapi/find` once by the resolver to get the tunnel address and then
a second request to `/webapi/find` by users of the `Resolver` to determine
the proxy listener mode. Propagating the listener mode along with the
tunnel address by the `Resolver` ensures only one `/webapi/find` call
is needed.

This is especially impactful because the `reversetunnel.TunnelAuthDialer`
which is used by the auth http client would do this everytime the
`http.Client` connection pool was empty. When the `http.Client` needed
to dial the auth server it was incurring the additional roundtrip to the
proxy.
rosstimothy added a commit that referenced this pull request Nov 2, 2022
)

By only providing the tunnel address from the `reversetunnel.Resolver`
callers would still need to lookup the proxy listener mode to determine
how to dial the address. This results in sending a request to
`/webapi/find` once by the resolver to get the tunnel address and then
a second request to `/webapi/find` by users of the `Resolver` to determine
the proxy listener mode. Propagating the listener mode along with the
tunnel address by the `Resolver` ensures only one `/webapi/find` call
is needed.

This is especially impactful because the `reversetunnel.TunnelAuthDialer`
which is used by the auth http client would do this everytime the
`http.Client` connection pool was empty. When the `http.Client` needed
to dial the auth server it was incurring the additional roundtrip to the
proxy.
rosstimothy added a commit that referenced this pull request Nov 2, 2022
)

By only providing the tunnel address from the `reversetunnel.Resolver`
callers would still need to lookup the proxy listener mode to determine
how to dial the address. This results in sending a request to
`/webapi/find` once by the resolver to get the tunnel address and then
a second request to `/webapi/find` by users of the `Resolver` to determine
the proxy listener mode. Propagating the listener mode along with the
tunnel address by the `Resolver` ensures only one `/webapi/find` call
is needed.

This is especially impactful because the `reversetunnel.TunnelAuthDialer`
which is used by the auth http client would do this everytime the
`http.Client` connection pool was empty. When the `http.Client` needed
to dial the auth server it was incurring the additional roundtrip to the
proxy.
@rosstimothy rosstimothy deleted the tross/tunnel_addr branch January 5, 2023 20:47
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.

3 participants