This repository has been archived by the owner on Sep 14, 2020. It is now read-only.
Disable socket timeouts for internal request, especially for watching #144
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.
Fix an issue with the operator dying in 10 seconds after starting — with
socket.timeout
andrequests.exceptions.ConnectionError
exceptions.Caused by the pykube's default of 10s for all requests, including the watch-requests (which are also
GET
). See hjacobs/pykube#32Introduced to Kopf in #110. Specifically, the timeouts were discussed there, and converted from no-timeouts to default 10s.
This PR reverts it back to no timeouts for all internal requests. This topic was also discussed in few other Kopf's PRs — it should work even on the slow clusters, even over the slow network connections (e.g. in IDEs over network).
And, in case the socket timeout will be revised or made configurable in the future, disable it explicitly for the watch-requests, and use the server-side timeouts instead via the query params — same as the official k8s client library does. This requires hjacobs/pykube#33
The server-side timeouts (
timeoutSeconds
param) are part of the K8s API. E.g. for pod-watching: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#watch-64Stacktrace: