Skip to content

listener: move active connection collection out of active tcp listener#16947

Merged
mattklein123 merged 32 commits intoenvoyproxy:mainfrom
lambdai:addinternallistener_pre_1
Aug 3, 2021
Merged

listener: move active connection collection out of active tcp listener#16947
mattklein123 merged 32 commits intoenvoyproxy:mainfrom
lambdai:addinternallistener_pre_1

Conversation

@lambdai
Copy link
Contributor

@lambdai lambdai commented Jun 11, 2021

Commit Message:

#16763 is adding an internal listener. The internal listener is not driven by event dispatcher.
However, it shares the common functionalities of structuring the ownership of connections with the tcp listener.

This PR extracts the common functions out of ActiveTcpListener so those can be reused by internal listener.
The common includes

  1. ActiveConnection definition
  2. The helper method of remove an active connection and remove an filter chain

Additional Description:
Risk Level: LOW
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]

lambdai and others added 9 commits June 1, 2021 10:57
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <lambdai@google.com>
lambdai added 2 commits June 11, 2021 23:04
Signed-off-by: Yuchen Dai <lambdai@google.com>
Signed-off-by: Yuchen Dai <lambdai@google.com>
Copy link
Contributor

@antoniovicente antoniovicente left a comment

Choose a reason for hiding this comment

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

Thanks for splitting this refactor from #16763. This change is significantly more possible to review.

Signed-off-by: Yuchen Dai <lambdai@google.com>
Copy link
Contributor Author

@lambdai lambdai left a comment

Choose a reason for hiding this comment

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

Thank you for the review! I addressed most of them except the inc/decConnections.

@lambdai
Copy link
Contributor Author

lambdai commented Jun 15, 2021

/wait

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
lambdai added 2 commits June 17, 2021 07:59
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
and push up Network::Connection op

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Copy link
Contributor

@antoniovicente antoniovicente left a comment

Choose a reason for hiding this comment

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

Yeah I understand it's just hard to track what is changing. My preference would be to wait until next week to see if @antoniovicente can finish this review. If that is not possible, would it be possible to just split again where you do the pure moves first (I think ActiveTcpSocket into its own file, etc.) and then the rest of it?

I'ld like a second opinion about the introduction of a template base class for code reuse. This kind of pattern has been a big source of complexity on past codebases I have been involved with. @mattklein123 could use your opinion. Other than that, I think this change is fine and is about as minimal as it can be except possibly the refactor to source/server/active_tcp_listener.h which exposes the inner classes.

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@lambdai lambdai changed the title listener: refactor active tcp socket and active tcp listener listener: move active connection collection out of active tcp listener Jul 28, 2021
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@lambdai
Copy link
Contributor Author

lambdai commented Jul 28, 2021

This PR is ready to be reviewed again: It turns to be a create a thin reused layer OwnedActiveStreamListenerBase

With this base class, ActiveConnection can be reused by both internal and tcp listener. And the error prone shared connection handling block are moved to here.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Please split out pure moves from code changes so it's easier to review the actual changes. Thank you!

/wait

@lambdai
Copy link
Contributor Author

lambdai commented Jul 30, 2021

@mattklein123 The entire PR is almost code move(file to file), or method move(from class to base class) or rename(refer to base class instead of derived).

I create a PR as your requested anyway: #17551

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
lambdai added 2 commits August 3, 2021 18:20
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
…nternallistener_pre_1

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattklein123 mattklein123 merged commit 75b7c07 into envoyproxy:main Aug 3, 2021
baojr added a commit to baojr/envoy that referenced this pull request Aug 4, 2021
…bridge-stream

* upstream/main: (32 commits)
  tls: move ssl connection info into SocketAddressProvider (envoyproxy#17334)
  conn pool: default enable runtime feature `conn_pool_delete_when_idle` (envoyproxy#17577)
  api: LEDS api introduction (envoyproxy#17419)
  kafka: add support for api versions request in mesh-filter (envoyproxy#17475)
  ext_proc: Implement BUFFERED_PARTIAL processing mode (envoyproxy#17531)
  tooling: Async/pathlib/mypy cleanups and utils (envoyproxy#17505)
  xds: restructure CertificateProvider fields (envoyproxy#17201)
  Refactor OverloadIntegrationTest breaking out a test base, and the fake resource monitors. (envoyproxy#17530)
  listener: move active connection collection out of active tcp listener (envoyproxy#16947)
  tools: format checks for backticks (envoyproxy#17566)
  coverage: set lower limit for common/quic and common (envoyproxy#17573)
  v2: final source removal (envoyproxy#17565)
  test: bumping coverage (envoyproxy#17564)
  quic: enforcing header size and contents (envoyproxy#17520)
  Support for canonicalizing URI properly for AWS SigV4 signer (envoyproxy#17137)
  listener: add a stat for transport socket connect timeout (envoyproxy#17458)
  listener: add listen() error handling (envoyproxy#17427)
  http: return per route config when direct response is set (envoyproxy#17449)
  removing most v2 references from source/ (envoyproxy#17415)
  bug fix: return bootstrap when validating config (envoyproxy#17499)
  ...

Signed-off-by: Garrett Bourg <bourg@squareup.com>
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
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