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

Reconsider model for injecting delays in HTTP requests #272

Open
pablochacin opened this issue Aug 1, 2023 · 0 comments · May be fixed by #282
Open

Reconsider model for injecting delays in HTTP requests #272

pablochacin opened this issue Aug 1, 2023 · 0 comments · May be fixed by #282
Labels
design proposal Requires a design document for discussion enhancement New feature or request

Comments

@pablochacin
Copy link
Collaborator

pablochacin commented Aug 1, 2023

When configured for injecting delays, the HTTP protocol proxy works like the following:

  1. Make a request upstream
  2. If it errors, return immediately
  3. If it does not error, sleep for the duration of the fault
  4. After that, copy the body to the client.

This approach has the advantage of allowing adjusting the delay to consider the duration of the upstream request. For example, if the delay defined in the fault injection is 500ms and the upstream takes 200ms, the proxy could then wait 300ms. Presently, this is not implemented but would be trivial.

On the other hand, it has the downside of stalling the connection upstream for the duration of the delay. This may have unwanted consequences, such as:

  1. Stealing resources from upstream, potentially causing it to behave differently than usual
  2. Causing upstream to abort the stalled connection with HTTP 408, which would then be forwarded to the client.

Alternatively, the proxy could sleep before making the requests, but in this case, it would add the delay on top of the delay of the request

@pablochacin pablochacin added enhancement New feature or request design proposal Requires a design document for discussion labels Aug 1, 2023
@pablochacin pablochacin linked a pull request Aug 8, 2023 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design proposal Requires a design document for discussion enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant