-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[python] Avoid creating unused ThreadPools #8061
base: master
Are you sure you want to change the base?
Conversation
cc @taxpon @frol @mbohlool @cbornet @kenjones-cisco for Python review |
LGTM, but it doesn't seem like you did:
|
Sorry, failed to commit it before. Looks like this had been missed a few times, since there are a few more changes in the results than mine. |
Had to fix a deserialization test that hadn't been updated since some changes in enums, I think. The failing test passed locally for me, hopefully Travis will find the same. |
LGTM |
Test failure appears to have been an intermittent network issue. Anything I can to do help this progress? |
Resolved conflicts. |
This blocks on exit the majority of times when more than one API client is created (kubernetes-client/python#411). What needs to be done to get this merged and released so the k8s Python API can be regenerated and fixed? |
Instead, create ApiClient.pool on first request for .pool property. avoids spawning n-cpus threads (the default for ThreadPool) at instantiation of every ApiClient
and default to 1 for putting requests in the background without triggering concurrency.
by running bin/python-*.sh
Rebased and rerendered again |
Happy anniversary #8061 🎉 |
…enapi-generator. * related * kubernetes-client/gen#93 * swagger-api/swagger-codegen#8061 * OpenAPITools/openapi-generator#1387 * Drop hack for empty reponses Bump versions: * sdks to 1.0.79 * core to 1.0.74
Was this ever merged? |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.3.0.0
branch for changes related to OpenAPI spec 3.0. Default:master
.Description of the PR
Instead, create ApiClient.pool on first request for .pool property.
This avoids spawning n-cpus threads (the default for ThreadPool) at instantiation of every ApiClient, which can be very costly in, for example, container scenarios on nodes with many CPUs where multiple API Clients might be instantiated in one process. kubernetes unconditionally instantiates an ApiClient only for serialization that never makes any requests every time a Watch is created, for example.
The thread count is made configurable and defaults to 1 instead of N-CPUs, which I think makes more sense for the default behavior of a non-blocking API.