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

Remove special defaultStrategy() merge method #2108

Merged
merged 3 commits into from
Mar 4, 2022

Conversation

bondolo
Copy link
Contributor

@bondolo bondolo commented Feb 26, 2022

Motivation:
The HttpExecutionStrategies.defaultStrategy() strategy currently
provides a special merge() implementation that, rather than merge,
simply returns the other strategy. This behavior is often surprising
and requires specific handling elsewhere to ensure that the strategy
has consistent merging when referenced reflexively.
Modifications:
Replace use of HttpExecutionStrategies.defaultStrategy().merge() with
explicit substitution of defaultStrategy() with the appropriate
strategy.
Result:
Reduced special behavior in the HttpExecutionStrategy implementation
which clarifies the actual interaction and behavior of strategies.

Motivation:
The `HttpExecutionStrategies.defaultStrategy()` strategy currently
provides a special `merge()` implementation that, rather than merge,
simply returns the other strategy. This behavior is often surprising
and requires specific handling elsewhere to ensure that the strategy
has consistent merging when referenced reflexively.
Modifications:
Replace use of `HttpExecutionStrategies.defaultStrategy().merge()` with
explicit substitution of `defaultStrategy()` with the appropriate
strategy.
Result:
Reduced special behavior in the `HttpExecutionStrategy` implementation
which clarifies the actual interaction and behavior of strategies.
@bondolo bondolo added the technical debt Reduces technical debt label Feb 26, 2022
@bondolo bondolo self-assigned this Feb 26, 2022
@bondolo bondolo requested a review from idelpivnitskiy March 4, 2022 22:06
@bondolo bondolo merged commit dd4b95d into apple:main Mar 4, 2022
bondolo added a commit to bondolo/servicetalk that referenced this pull request Apr 15, 2022
Motivation:
The changes in apple#2108 introduced a regression in the handling of
computation of the effective strategy of a client when a
strategy `offloadNone()` (or the deprecated `offloadNever()`) was used
with the  `HttpClientBuilder`. Rather than preventing all offloading,
the computed offloading was used.
Modifications:
If the strategy specified on the `HttpClientBuilder` does not specify
any offloads then no offloading will be used.
Result:
The offloading behavior matches the requested behavior specified on
the  `HttpClientBuilder`.
bondolo added a commit to bondolo/servicetalk that referenced this pull request Jun 7, 2022
Motivation:
The changes in apple#2108 introduced a regression in the handling of
computation of the effective strategy of a client when a
strategy `offloadNone()` (or the deprecated `offloadNever()`) was used
with the  `HttpClientBuilder`. Rather than preventing all offloading,
the computed offloading was used.
Modifications:
If the strategy specified on the `HttpClientBuilder` does not specify
any offloads then no offloading will be used.
Result:
The offloading behavior matches the requested behavior specified on
the  `HttpClientBuilder`.
idelpivnitskiy pushed a commit that referenced this pull request Jun 8, 2022
Motivation:
The changes in #2108 introduced a regression in the handling of
computation of the effective strategy of a client when a
strategy `offloadNone()` (or the deprecated `offloadNever()`) was used
with the  `HttpClientBuilder`. Rather than preventing all offloading,
the computed offloading was used.

Modifications:
If the strategy specified on the `HttpClientBuilder` does not specify
any offloads then no offloading will be used.

Result:
The offloading behavior matches the requested behavior specified on
the  `HttpClientBuilder`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical debt Reduces technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants