-
Notifications
You must be signed in to change notification settings - Fork 182
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
Make RequestConcurrencyController
public
#2278
Make RequestConcurrencyController
public
#2278
Conversation
Motivation: Users can not wrap connections inside the `LoadBalancer` or `HttpLoadBalancerFactory` because `RequestConcurrencyController` API is internal. Modifications: - Move `RequestConcurrencyController` and `ReservableRequestConcurrencyController` from `client-api-internal` to `client-api`; - `FilterableStreamingHttpLoadBalancedConnection` now extends `ReservableRequestConcurrencyController` and `ReservedStreamingHttpConnection`; - Introduce `HttpLoadBalancerFactory#toLoadBalancedConnection` overload that also accepts `ReservableRequestConcurrencyController`, deprecate pre-existing overload; - Add `DefaultFilterableStreamingHttpLoadBalancedConnection` that helps users combine `FilterableStreamingHttpConnection`, `ReservableRequestConcurrencyController` and `ScoreSupplier` or do wrapping; - Remove `LoadBalancedStreamingHttpConnection` as it's not required anymore; - Update internals to use new API; Result: Users can wrap the `FilterableStreamingHttpLoadBalancedConnection` inside their `LoadBalancer` or `HttpLoadBalancerFactory` implementations.
FilterableStreamingHttpConnection connection); | ||
default FilterableStreamingHttpLoadBalancedConnection toLoadBalancedConnection( | ||
FilterableStreamingHttpConnection connection, | ||
ReservableRequestConcurrencyController concurrencyController) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm open to discussions here. For now, I tried to keep pre-existing assumption that the HttpLoadBalancerFactory
knows how to implement score()
for the passed connection. In practice, the score()
implementation may not be self-sufficient and can rely on external information from the LB or CF. Since we already pass the ContextMap
through request -> selectConnection -> newConnection
chain, we can add it here as a 3rd nullable argument too to preserve that context info. LMK WDYT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed with @tkountis offline and agreed to add the context as the 3rd arg. It may be helpful to propagate information between layers without API changes in the future. Also, consistency with selectConnection
and newConnection
.
@tkountis your offline comments addressed, please have another look |
Nice work. |
…le#2278 Motivation: apple#2278 moved `RequestConcurrencyController` and `ReservableRequestConcurrencyController` from `client-api-internal` to `client-api` module. This is an API incompatible change for 0.42.x. Also, it removed `DefaultHttpLoadBalancerFactory#toLoadBalancedConnection` impl, this is a binary incompatible change. Modifications: - Restore `io.servicetalk.client.api.internal.RequestConcurrencyController` and `io.servicetalk.client.api.internal.ReservableRequestConcurrencyController` interfaces and all references to them in `client-api-internal` module; - Create a pkg-private copy of `ReservableRequestConcurrencyControllers` inside `http-netty` module that targets public `io.servicetalk.client.api.ReservableRequestConcurrencyController`; - Copy tests for `ReservableRequestConcurrencyControllers`; - Create a pkg-private copy of `io.servicetalk.client.api.internal.IgnoreConsumedEvent` in `http-netty` module; - Deprecate all classes and interfaces in `client-api-internal` module; - Remove unnecessary references to `servicetalk-client-api-internal` dependency in modules that don't actually depend on it; Result: 1. The next 0.42.14 release will be backward compatible with 0.42.13. 2. The whole `servicetalk-client-api-internal` module is deprecated now and can be removed in the future releases. Signed-off-by: Idel Pivnitskiy <idel.pivnitskiy@apple.com>
… (#2306) Motivation: #2278 moved `RequestConcurrencyController` and `ReservableRequestConcurrencyController` from `client-api-internal` to `client-api` module. This is an API incompatible change for 0.42.x. Also, it removed `DefaultHttpLoadBalancerFactory#toLoadBalancedConnection` impl, this is a binary incompatible change. Modifications: - Restore `io.servicetalk.client.api.internal.RequestConcurrencyController` and `io.servicetalk.client.api.internal.ReservableRequestConcurrencyController` interfaces and all references to them in `client-api-internal` module; - Create a pkg-private copy of `ReservableRequestConcurrencyControllers` inside `http-netty` module that targets public `io.servicetalk.client.api.ReservableRequestConcurrencyController`; - Copy tests for `ReservableRequestConcurrencyControllers`; - Create a pkg-private copy of `io.servicetalk.client.api.internal.IgnoreConsumedEvent` in `http-netty` module; - Deprecate all classes and interfaces in `client-api-internal` module; - Remove unnecessary references to `servicetalk-client-api-internal` dependency in modules that don't actually depend on it; Result: 1. The next 0.42.14 release will be backward compatible with 0.42.13. 2. The whole `servicetalk-client-api-internal` module is deprecated now and can be removed in future releases.
Motivation: apple#2278 added a new connection wrapper `DefaultFilterableStreamingHttpLoadBalancedConnection` that does not implement `toString()`. It hides the channel id in RRLB logs. Modifications: - Implement `toString()` for `DefaultFilterableStreamingHttpLoadBalancedConnection` in `HttpLoadBalancerFactory` and `DefaultHttpLoadBalancerFactory`; - Make `AbstractStreamingHttpConnection#toString()` final; Result: RRLB logs include channel id.
Motivation: #2278 added a new connection wrapper `DefaultFilterableStreamingHttpLoadBalancedConnection` that does not implement `toString()`. It hides the channel id in RRLB logs. Modifications: - Implement `toString()` for `DefaultFilterableStreamingHttpLoadBalancedConnection` in `HttpLoadBalancerFactory` and `DefaultHttpLoadBalancerFactory`; - Make `AbstractStreamingHttpConnection#toString()` final; Result: RRLB logs include channel id.
Motivation:
Users can not wrap connections inside the
LoadBalancer
orHttpLoadBalancerFactory
becauseRequestConcurrencyController
API isinternal.
Modifications:
RequestConcurrencyController
andReservableRequestConcurrencyController
fromclient-api-internal
toclient-api
;LoadBalancedConnection
now extendsReservableRequestConcurrencyController
;FilterableStreamingHttpLoadBalancedConnection
now extendsReservedStreamingHttpConnection
;HttpLoadBalancerFactory#toLoadBalancedConnection
overloadthat also accepts
ReservableRequestConcurrencyController
andContextMap
;HttpLoadBalancerFactory#toLoadBalancedConnection(FilterableStreamingHttpConnection)
;DefaultFilterableStreamingHttpLoadBalancedConnection
that helpsusers combine
FilterableStreamingHttpConnection
,ReservableRequestConcurrencyController
andScoreSupplier
or dowrapping;
LoadBalancedStreamingHttpConnection
as it's not requiredanymore;
Result:
Users can wrap the
FilterableStreamingHttpLoadBalancedConnection
inside their
LoadBalancer
orHttpLoadBalancerFactory
implementations.