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

Supports connection pool reuse in http2 proxy (nginx/envoy) #12329

Open
godhth opened this issue Jul 10, 2024 · 6 comments
Open

Supports connection pool reuse in http2 proxy (nginx/envoy) #12329

godhth opened this issue Jul 10, 2024 · 6 comments
Assignees
Labels
kind/discussion Category issues related to discussion

Comments

@godhth
Copy link
Contributor

godhth commented Jul 10, 2024

Is your feature request related to a problem? Please describe.
当使用http2(nginx/envoy)代理时,由于网关使用了连接池管理复用连接,而nacos仅支持单个client 使用单个连接,导致重复的连接无法建立双向流。

When using the http2 (nginx/envoy) proxy, because the gateway uses a connection pool to manage multiplexed connections, nacos only supports a single client to use a single connection, resulting in repeated connections that cannot establish a bidirectional stream.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@KomachiSion
Copy link
Collaborator

Nacos的连接是有意义的, 被代理复用后可能会导致数据串掉, 这个是怎么解决的?

@KomachiSion
Copy link
Collaborator

这个改动很大,需要完整的设计一下。

@KomachiSion KomachiSion added the kind/discussion Category issues related to discussion label Jul 10, 2024
@godhth
Copy link
Contributor Author

godhth commented Jul 10, 2024

数据是通过不同stream来区分的,复用一个连接,但是streamId不同,每个streamObserver不同,数据不会串。
现在的问题是复用的连接,nacos认为是重复的,没有保存到ConnectionManager,因为当前的connectionId只能代表实际的物理连接,复用这种情况其实是逻辑连接。
所以我一开始想的是给connectionId 加上双向流的streamId的属性 来达到逻辑连接的效果,但是单向流获取不到双向流的streamId,单向流里也需要使用connectionId ,所有放弃了这个想法,进而使用给客户端增加一个标识来达到类似的目的,

实现了逻辑连接的效果,那么复用的连接也会被正确register 到ConnectionManager中,每个逻辑连接注册的streamObserver是不同的,所以数据不会串。

@godhth
Copy link
Contributor Author

godhth commented Jul 10, 2024

0880c4c8071081a9fb23

@KomachiSion
Copy link
Collaborator

@shiyiyue1102 help to review this design.

@KomachiSion
Copy link
Collaborator

This feature is a big changes for nacos connection between server and client.

It should be an experimental feature, If want to do this, Please make sure following:

  1. do code abstract, make your add feature code is independent and make sure remove them will not cause current connection way problem.
  2. add switch for this feature and default false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/discussion Category issues related to discussion
Projects
None yet
Development

No branches or pull requests

3 participants