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

[feat][proxy] Support proxy limit maximum connections per IP #17167

Merged
merged 19 commits into from Aug 29, 2022
Merged

[feat][proxy] Support proxy limit maximum connections per IP #17167

merged 19 commits into from Aug 29, 2022

Conversation

mattisonchao
Copy link
Member

Motivation

Pulsar has the brokerMaxConnectionsPerIp configuration at the
broker, we can use it to limit the maximum connections per IP.

The original motivation and PR here: #10754

IMO, we can also apply it to pulsar-proxy, because when a large
number of proxy accesses under the same IP (maybe due to some wrong
operations) will cause the proxy to accept too much wrong traffic and
cause service unstable.

Discussion link: https://lists.apache.org/thread/co00zx8ns3ksbccxs82lfh624rx1sht6

Modifications

  • Reuse ConnectionController for proxy part.
  • Move ConnectionController to broker-common module.
  • Add proxy configuration maxConcurrentInboundConnectionsPerIp
  • Send ServerError.NotAllowedError command to prevent client reconnecting.

Verifying this change

  • Make sure that the change passes the CI checks.

Documentation

Check the box below or label this PR directly.

Need to update docs?

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@mattisonchao mattisonchao marked this pull request as ready for review August 19, 2022 01:33
@mattisonchao mattisonchao self-assigned this Aug 19, 2022
@mattisonchao mattisonchao added this to the 2.12.0 milestone Aug 19, 2022
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

@Technoboy- Technoboy- added type/feature The PR added a new feature or issue requested a new feature area/proxy labels Aug 24, 2022
Copy link
Contributor

@Jason918 Jason918 left a comment

Choose a reason for hiding this comment

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

LGTM

mattisonchao and others added 2 commits August 26, 2022 10:36
…yConfiguration.java

Co-authored-by: Nicolò Boschi <boschi1997@gmail.com>
Copy link
Contributor

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/proxy type/feature The PR added a new feature or issue requested a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants