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

4.1.3: Concurrency limits module, and support in Helidon WebServer #9384

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

barchetta
Copy link
Member

Backport of #9295 to Helidon 4.1.3

Description

Resolves #8897
Resolves #9229

Documentation

This PR introduces

  • a new module common/concurrency/limits that provides API and SPI for concurrency limit implementations, and a couple of default implementations (AIMD, Fixed).
  • a new module webserver/concurrency-limits that provides feature with a filter to impose limits within a filter in routing
  • update of webserver/webserver to use a Limit instead of a Semaphore in connection handlers (backward compatible)

Configuration reference will be in the generated documentation.

Configure limits on WebServer

This will configure limit for a server listener (configurable per listener), enforced on the connection level (i.e. outside of routing and filters).

The default behavior is the same (unlimited).
If server.max-concurrent-requests is configured (value is not -1), it will be used and concurrency-limit configuration for the listener will be ignored.

Configuration:

server:
  port: 8080
  concurrency-limit:
    aimd: # `limit type`
      # AIMD limit configuration

Configure limits for routing

This will configure limit for as a server feature, enforced in an HTTP filter.
Configuration:

server:
  features:
    limits: # the feature is called `limits`
      enabled: true
      concurrency-limit: # `limit` configuration of the `limits` server feature
        fixed: # `limit type`
          permits: 1
          queue-length: 10

…idon-io#9295)

* Concurrency limits module, and support in Helidon WebServer
* Align configuration key for server feature and server.
* Refactored to use tokens.
* Added tests for configuration based limits.
* Added copy to a limit, so we can get another instance with the same configuration.
* Added support to bypass queuing and return immediately.

Signed-off-by: Tomas Langer <[email protected]>
Co-authored-by: André Rouél <[email protected]>
Signed-off-by: Tomas Langer <[email protected]>
@barchetta barchetta added webserver backport Issues that are merged into a single branch, but missing in either master or previous release 4.x Version 4.x labels Oct 14, 2024
@barchetta barchetta added this to the 4.1.3 milestone Oct 14, 2024
@barchetta barchetta self-assigned this Oct 14, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 14, 2024
@barchetta barchetta mentioned this pull request Oct 14, 2024
16 tasks
tomas-langer
tomas-langer previously approved these changes Oct 14, 2024
@barchetta barchetta merged commit a8b434a into helidon-io:helidon-4.1.x Oct 14, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x backport Issues that are merged into a single branch, but missing in either master or previous release OCA Verified All contributors have signed the Oracle Contributor Agreement. webserver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants