add nginx keepalive_timeout env to prevent race condition on gorouter #637
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.
the current default of 30 causes the same inconsistent 502's as https://community.pivotal.io/s/article/5004y00001buMQz1626802995951?language=en_US
and we need to set it to >90s so the gorouter is in charge of closing the connections
https://docs.cloudfoundry.org/adminguide/routing-keepalive.html
tl;dr
Reason for this change:
With GoRouter's 90s keep alive enabled and the build pack's 30s it caused a intermittent EOF errors on the gorouter because it was trying to use an already closed connection...
and on the client this header
Here are the two links as ref:
Keepalive Considerations
https://docs.cloudfoundry.org/adminguide/routing-keepalive.html
Similar behaviour on spring apps
https://community.pivotal.io/s/article/5004y00001buMQz1626802995951?language=en_US
Testing this change:
Without any changes:
Then with the envvar
This app starts posting to /xas twice every 10s and on long running tests with puppeteer the error's are not present when the nginx keepalive timeout is 100s