Description
This is a potential issue I found on python client after testing a very badly implemented app which create an API client once in a few seconds!! 😛
The client (api_client.py) creates a ThreadPool on initialization, but it is not closed or cleared. From what I found on little-available documentation on threadPool, it has to be closed.
Suggestions:
Add close() and join() for the "destructor". Once the destructor start to close and join the threads, the system showed no problem after many hours of operations throughout few days.
ref: https://www.codementor.io/lance/simple-parallelism-in-python-du107klle
I can do a PR if this is acceptable.
def __del__(self):
self.pool.close()
self.pool.join()
Swagger-codegen version
Spec: 2.0, Codegen: 2.3
Command line used for generation
python client. Nothing special!
swagger-codegen -l python
Steps to reproduce
Try to create client once a second or such small interval (speed up to see results quicker xD), the system will run out of threads. (bad implementations can easily show this.!)
Description
This is a potential issue I found on python client after testing a very badly implemented app which create an API client once in a few seconds!! 😛
The client (api_client.py) creates a ThreadPool on initialization, but it is not closed or cleared. From what I found on little-available documentation on threadPool, it has to be closed.
Suggestions:
Add close() and join() for the "destructor". Once the destructor start to close and join the threads, the system showed no problem after many hours of operations throughout few days.
ref: https://www.codementor.io/lance/simple-parallelism-in-python-du107klle
I can do a PR if this is acceptable.
Swagger-codegen version
Spec: 2.0, Codegen: 2.3
Command line used for generation
python client. Nothing special!
swagger-codegen -l python
Steps to reproduce
Try to create client once a second or such small interval (speed up to see results quicker xD), the system will run out of threads. (bad implementations can easily show this.!)