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

[PR] Allow for custom timeout in watch request #322

Closed
5 tasks
kopf-archiver bot opened this issue Aug 18, 2020 · 0 comments
Closed
5 tasks

[PR] Allow for custom timeout in watch request #322

kopf-archiver bot opened this issue Aug 18, 2020 · 0 comments

Comments

@kopf-archiver
Copy link

kopf-archiver bot commented Aug 18, 2020

A pull request by pshchelo at 2020-03-06 15:57:06+00:00
Original URL: zalando-incubator/kopf#322
Merged by nolar at 2020-03-18 20:33:59+00:00

What do these changes do?

allow to set a custom timeout when making the GET ..?watch=true request to Kubernetes API if needed.

Description

Currently the timeout is always None, which we find to be a reason for issues like #204 .
With this patch controller authors may override the timeout passed by kopf to the underlying aiohttp session request by doing something like this in their controller code:

import kopf

kopf.config.WatchersConfig.session_timeout = 10.0

@kopf.on(..)
def handler(*):
    ....

The default behavior is not changed.

Issues/PRs

Issues: #204

Type of changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • The code addresses only the mentioned problem, and this problem only
  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt

Commented by pshchelo at 2020-03-10 10:16:01+00:00
 

interestingly enough, coveralls job fails and reports as not covered lines I did not change/add...


Commented by nolar at 2020-03-10 12:01:04+00:00
 

Coveralls decrease is all fine. It fluctuates a little bit here & there.

Regarding the feature: Can you please refactor it to make the timeout as float instead of aiohttp.ClientTimeout?

Usage of aiohttp is a hidden detail of the current implementation and can change in the future. The session/client timeouts will probably stay, just differently implemented inside of kopf.clients.*.

UPD: Actually, Optional[float] = None, not just float.


Commented by pshchelo at 2020-03-15 11:09:17+00:00
 

Ack, sounds reasonable, will do

@kopf-archiver kopf-archiver bot closed this as completed Aug 18, 2020
@kopf-archiver kopf-archiver bot changed the title [archival placeholder] [PR] Allow for custom timeout in watch request Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant