WIP: Decouple request forwarding from delay #282
Draft
+64
−41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 takes100ms
, currently the total delay would be600ms
while after this PR it will be500ms
. On the other hand, if the response time of the request were700ms
the total delay would be700ms
.Fixes #272
Checklist:
make lint
) and all checks pass.make test
) and all tests pass.make e2e-xxx
foragent
,disruptors
,kubernetes
orcluster
related changes)