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

[Python] Lazily initialize thread pool #945

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jorisgillis
Copy link

Porting a Swagger Codegen 2 fix to Swagger Codegen 3.
The ThreadPool pool is only used for async requests.
If a client is not making any async requests, the pool is
initialized and needs to be shutdown regardless. Taking up
resources (threads) and putting a burden on the end user
of the generated client to properly shut down the thread
pool.

swagger-api/swagger-codegen@ebc8313#diff-d7b82d024488f96a18a1c76247f1bd57cbde141f28defe6f45b04ce566ab5aeb

Relates to: swagger-api/swagger-codegen#11141

Joris Gillis and others added 2 commits August 23, 2021 09:29
Porting a Swagger Codegen 2 fix to Swagger Codegen 3.
The ThreadPool `pool` is only used for async requests.
If a client is not making any async requests, the pool is
initialized and needs to be shutdown regardless. Taking up
resources (threads) and putting a burden on the end user
of the generated client to properly shut down the thread
pool.

swagger-api/swagger-codegen@ebc8313#diff-d7b82d024488f96a18a1c76247f1bd57cbde141f28defe6f45b04ce566ab5aeb
@Mainian
Copy link

Mainian commented Oct 19, 2022

Stumbled upon this solution because swagger codegen v3's python client won't work inside of a lambda as generated.

I think this will link to the correct issue if you tag a commit or update the description with:Fixes swagger-api/swagger-codegen#11141

Reference: Linking a pull request to an issue using a keyword

I think this probably needs to be opened as an issue in this repo though.

@vfreysz
Copy link

vfreysz commented Mar 20, 2024

any update ?

@tomek360
Copy link

Could you merge that fix?

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

Successfully merging this pull request may close these issues.

4 participants