ory / oathkeeper

A cloud native Identity & Access Proxy / API (IAP) and Access Control Decision API that authenticates, authorizes, and mutates incoming HTTP(s) requests. Inspired by the BeyondCorp / Zero Trust white paper. Written in Go.
https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=hydra
Apache License 2.0
3.24k stars 357 forks source link

feat(cmd/serve): add in default-shutdown-timeout flag to increase shutdown timeout on http server shutdown #1162

Open ottingbob opened 5 months ago

ottingbob commented 5 months ago

Under the hood ory/oathkeeper uses https://github.com/ory/graceful to shutdown the HTTP proxy. The graceful package provides a constant called DefaultShutdownTimeout which sets the timeout to be 5 seconds.

We have an application that can take up to 60 seconds to finish processing requests and we need a solution to be able to change this shutdown time in order for those requests to complete successfully.

As a result, we need a way to configure oathkeeper to bump up that timeout and the implementation has a flag that will be able to override the global variable set in the graceful package. Although this does not seem like the most ideal solution it provides a way for us to change that value.

Curious to hear suggestions on what may be an alternative approach to get a similar outcome & would be happy to try and make the changes needed for any feedback to help enable that.

Checklist

CLAassistant commented 5 months ago

CLA assistant check
All committers have signed the CLA.

ottingbob commented 5 months ago

Curious to hear suggestions on what may be an alternative approach to get a similar outcome & would be happy to try and make the changes needed for any feedback to help enable that

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.81%. Comparing base (8fc9b7a) to head (2d97c76). Report is 6 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1162 +/- ## ========================================== - Coverage 77.90% 77.81% -0.09% ========================================== Files 80 80 Lines 3929 4044 +115 ========================================== + Hits 3061 3147 +86 - Misses 595 617 +22 - Partials 273 280 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.