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

Consider request strategy when we schedule timeouts or retries #2482

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

Currently, timeout and retrying filter uses an HttpExecutionStrategy from the ExecutionContext. However, on the requester side users can either use a different API that optimizes the pre-computed strategy or they can put a custom strategy per request.

Modifications:

  • For RetryingHttpRequesterFilter, compute alternativeTimerExecutor based on HTTP_EXECUTION_STRATEGY_KEY;
  • For TimeoutHttpRequesterFilter, compute useForTimeout based on HTTP_EXECUTION_STRATEGY_KEY;
  • Adjust tests for new behavior;

Result:

  1. On the client-side, the actual HttpExecutionStrategy associated with the request is considered.
  2. Less use of offloading executor when there is no need to offload.

Motivation:

Currently, timeout and retrying filter uses an `HttpExecutionStrategy` from the
`ExecutionContext`. However, on the requester side users can either use a different
API that optimizes the pre-computed strategy or they can put a custom strategy
per request.

Modifications:

- For `RetryingHttpRequesterFilter`, compute `alternativeTimerExecutor` based on
`HTTP_EXECUTION_STRATEGY_KEY`;
- For `TimeoutHttpRequesterFilter`, compute `useForTimeout` based on
`HTTP_EXECUTION_STRATEGY_KEY`;
- Adjust tests for new behavior;

Result:

1. On the client-side, the actual `HttpExecutionStrategy` associated with the
request is considered.
2. Less use of offloading executor when there is no need to offload.
@idelpivnitskiy idelpivnitskiy self-assigned this Jan 5, 2023
@idelpivnitskiy idelpivnitskiy changed the title Consider request context when we schedule timeouts or retries Consider request strategy when we schedule timeouts or retries Jan 5, 2023
@idelpivnitskiy idelpivnitskiy merged commit 35d326c into apple:main Jan 6, 2023
@idelpivnitskiy idelpivnitskiy deleted the executor branch January 6, 2023 17:05
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.

2 participants