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

WIP: Decouple request forwarding from delay #282

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pablochacin
Copy link
Collaborator

@pablochacin pablochacin commented Aug 8, 2023

Description

This PR decouples the logic for forwarding the request to an upstream target, from the logic that manages the delay introduced by the fault injection.

Using this decoupling, this PR also changes the way in which delays are applied. Currently, this delay is added on top of the response time of the request. After this PR, the delay will be the maximum between the one specified in the fault and the actual response time of the request.

For example, if a fault injection specifies a delay of 500ms and the request takes 100ms, currently the total delay would be 600ms while after this PR it will be 500ms. On the other hand, if the response time of the request were 700ms the total delay would be 700ms.

Fixes #272

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make test) and all tests pass.
  • I have run relevant e2e test locally (make e2e-xxx for agent, disruptors, kubernetes or cluster related changes)
  • Any dependent changes have been merged and published in downstream modules

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.

Reconsider model for injecting delays in HTTP requests
1 participant