-
Notifications
You must be signed in to change notification settings - Fork 72
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
fix rest api aiohttp timeout #337
Conversation
Thanks for your PR. Could you explain how this change fixes issues you mentioned? |
The code from official kubernetes client timeout = None
if _request_timeout:
if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821
timeout = urllib3.Timeout(total=_request_timeout)
elif (isinstance(_request_timeout, tuple) and
len(_request_timeout) == 2):
timeout = urllib3.Timeout(
connect=_request_timeout[0], read=_request_timeout[1]) So Additionally, according to the _request_parameter doc::
The if _request_timeout is tuple that case is not handled. PrefectHQ/prefect#14954 In both issues, where So my fix which replicates the timeout behaviour same as offiicial kubernetes client should fix the issue. This will be helpful to migrate from official kubernetes client to kubernetes_asyncio. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #337 +/- ##
==========================================
+ Coverage 27.31% 27.35% +0.03%
==========================================
Files 794 795 +1
Lines 96301 96326 +25
==========================================
+ Hits 26305 26347 +42
+ Misses 69996 69979 -17 ☔ View full report in Codecov by Sentry. |
Thanks for your explanation. It makes sense. Unfortunately this is a breaking change, so it'll be released with the next "big" release - 1.32.x (~ December 2024) |
Actually, aiohttp has a default timeout too - 5mins: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/client.py#L219 |
Yes I confirmed that changes does solve the issue as in case of And I also added test case for this changes. Thanks. |
Is this PR still in progress or it is abandoned? |
I added the requested changes @tomplus @NicholasFiorentini please review. |
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.
LGTM, thank you.
Do we know when a new release with this fix will be available? |
I'm going to release this change with the next "big" release - 1.32.x (11 December 2024, https://www.kubernetes.dev/resources/release/). |
@NicholasFiorentini It has been deployed, version 1.32.0 contains this fix. |
Thank you @tomplus ! |
Implement timeout behavior same as official python Kubernetes client: https://github.com/kubernetes-client/python/blob/f414832bb05b946eb1758df12f08806b44dd315e/kubernetes/client/rest.py#L146
Following issues will be resolved by this fix: