Make WriteTimeout, ReadTimeout and IdleTimeout configurable #468
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.
Closes #317
This seems to fix the issue experienced in the aforementioned ticket, for me, and hopefully the original author. No more intermittent 502s from the ALB once I raised Vouch's timeouts to 65s (because the ALB's idle timeout is 60s and the FIN/RST issue occurs as described here). I am using the env vars so I know that works too.
As soon as I adjust the IdleTimeout value back to 15 (the default), the problem re-appears in my setup. That's the best proof of test I can offer... it might be hard for you to reproduce without a similar setup.
I am keeping the default timeouts to 15s to maintain the status quo. From my reading, when IdleTimeout was not set (as it wasn't previously in Vouch), Go uses the value of ReadTimeout. So in effect, I don't think this will cause any issues for existing installations.
P.S after I built this, I had changes to versions/packages in go.mod / go.sum. At a glance, they looked like automatic upgrades to dependency packages pulled in via my
./do.sh goget. I have excluded those changes here, as I don't consider them related to the change, but let me know if you want me to add them in.