-
Notifications
You must be signed in to change notification settings - Fork 11
fix: Setting TCP keepalive values #116
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
Conversation
|
Unit tests will succeed after #114 is merged. |
stepansergeevitch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have an integration test for this case?
We can, but it would significantly slow down integration tests execution. The test needs to run for 360 seconds. |
|
|
||
| DEFAULT_TIMEOUT_SECONDS: int = 5 | ||
| KEEPALIVE_FLAG: int = 1 | ||
| KEEPIDLE_RATE: int = 60 # seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do I understand correctly, as long as this value is less than 350, the trick will work, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically yes, I was trying to find a typical expected value for this but it differs a lot. Wiki gives 45-60 range so I went with the latter.
yuryfirebolt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good
|
As discussed offline, added integration tests here anyway. Will look into parallelising the integration tests as a separate PR. |
|
Kudos, SonarCloud Quality Gate passed! |








https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html#connection-idle-timeout
ALB timeout is set to 350 seconds. If any connection is kept for longer than that it will be abandoned. This leads to long-running queries being stuck.
Those two settings set keepalive mechanism on TCP to avoid the above.
Fix can be tested using
#114 is a pre-requisite since httpcore has changed how it interacts with sockets and different way of overriding is needed with the old version.