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

Using TCP keepalive on Azure #117

Open
amotl opened this issue Nov 19, 2020 · 2 comments
Open

Using TCP keepalive on Azure #117

amotl opened this issue Nov 19, 2020 · 2 comments

Comments

@amotl
Copy link
Member

amotl commented Nov 19, 2020

Dear @MarkusH, @chaudum, @lukasbals and @Taliik,

regarding the infamous Azure TCP idle connection drop problem (crate/crate#10779), I would like to give you a heads-up in the context of Kubernetes operators (Azure/AKS#1877).

According to dev-obs/actus#272, AKS clusters running Kubernetes v1.19+ are currently receiving a bugfix

The AKS control plane will always send RST for idle connections after 4min.

So, this will probably mitigate any problems in this regard for connections through kubernetes-asyncio.

With kind regards,
Andreas.

P.S.: However, I don't know whether any connections through aiopg might still be affected.

@amotl
Copy link
Member Author

amotl commented Nov 19, 2020

However, I don't know whether any connections through aiopg might still be affected.

On the psycopg2 side, this has been discussed within psycopg/psycopg2#113 and psycopg/psycopg2#561. On aiopg, aio-libs/aiopg#491 might be related.

In order to mitigate that, efforts on psycopg2 coming from psycopg/psycopg2#565 and psycopg/psycopg2#974 apparently have been wrapped into psycopg2-pool, see also liberapay/postgres.py#80.

So, while I want to apologize that I didn't look into how socket options can be set directly like crate/crate-python#374 when using aiopg, I am inclined to believe that the pool_recycle option of aiopg.create_pool() might help us here:

pool_recycle (float) – number of seconds after which connection is recycled, helps to deal with stale connections in pool, default value is -1, means recycling logic is disabled.

@amotl
Copy link
Member Author

amotl commented Sep 6, 2023

GH-548 addresses this. Thank you, @SStorm.

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

No branches or pull requests

1 participant