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

Add environment parameters (and description) to configure proxy server timeout settings #132

Merged
merged 2 commits into from
Nov 5, 2018

Conversation

7phs
Copy link
Contributor

@7phs 7phs commented Nov 3, 2018

Add environment parameters (and description) to configure timeout settings

It will help prevent a case of unexpected closing a client connection if an upstream request is executing more than default timeout.

Signed-off-by: Aleksei Piianin piyanin@gmail.com

#64 @aeneasr

I have a deployed ORY infrastructure (Hydra, OathKeeper, Keto) and have a case: clients connection "unexpected" closing if an upstream request was executing more than write timeout (10 seconds):

The case:

  1. A client sends a request.
  2. Oathkeeper processing it and make an upstream request.
  3. A client and Oathkeeper are waiting a response - just about 20-30 seconds.
  4. Oathkeeper successful processing a request.
  5. But the client got a closing connection.

Has different cases when the timeout of the proxy server should configuring in different durations and offered changings would helping to solve them.

  • [X ] I have read the contributing guidelines
  • I confirm that this pull request does not address a security vulnerability. If this pull request addresses a security
    vulnerability, I confirm that I got green light (please contact hi@ory.sh) from the maintainers to push the changes.
  • I signed the Developer's Certificate of Origin
    by signing my commit(s). You can amend your signature to the most recent commit by using git commit --amend -s. If you
    amend the commit, you might need to force push using git push --force HEAD:<branch>. Please be very careful when using
    force push.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation within the code base (if appropriate)
  • I have documented my changes in the developer guide (if appropriate)

…tings of a server handled proxy requests.

It will help prevent a case of unexpected closing a client connection if an upstream request is executing more than default timeout.

Signed-off-by: Aleksei Piianin <piyanin@gmail.com>
@aeneasr
Copy link
Member

aeneasr commented Nov 4, 2018

Looks pretty good! I'll give it a thorough review on Monday and probably merge by then as well!

Signed-off-by: Aleksei Piianin <piyanin@gmail.com>
@aeneasr
Copy link
Member

aeneasr commented Nov 5, 2018

Thank you for the PR. So the problem is that graceful shuts down the http connection (to prevent stragglers) although the upstream is still sending? Or is the issue that the upstream connectivity (in this case executed by the roundtripper) is being closed unexpectedly?

@7phs
Copy link
Contributor Author

7phs commented Nov 5, 2018

Neither sending nor upcoming related.
The problem is closing a client connection after successful executing upstream request by ory/graceful library with default write timeout. The response body is completely read, as it is placed in the buffer for reading in the standard net/http package or ReverseProxy (I debugged it).
A client connection will be closing by ory/graceful library on starting sending a completely read response to a client if waiting time for a response more than write timeout.
Without ory/graceful library all working fine (I commented it when investigating problem).

@aeneasr
Copy link
Member

aeneasr commented Nov 5, 2018

Cool, thank you for the explanation and PR!

1 similar comment
@aeneasr
Copy link
Member

aeneasr commented Nov 5, 2018

Cool, thank you for the explanation and PR!

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.

None yet

2 participants