Yiyang Zhou created THRIFT-5454:
-----------------------------------
Summary: Python TProcessPoolServer does not spawn expected number
of worker processes
Key: THRIFT-5454
URL: https://issues.apache.org/jira/browse/THRIFT-5454
Project: Thrift
Issue Type: Bug
Components: Python - Library
Reporter: Yiyang Zhou
When using Python TProcessPoolServer with more than 1 workers, only one worker
process will be successfully spawned and all the other processes will reach a
pickling error and exit. As a result, with the default settings, only one
worker process is processing requests, whereas 10 workers are expected.
```bash
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/thrift-0.16.0-py3.9-macosx-10.9-x86_64.egg/thrift/server/TProcessPoolServer.py",
line 106, in serve
w.start()
File
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py",
line 121, in start
self._popen = self._Popen(self)
File
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py",
line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py",
line 284, in _Popen
return Popen(process_obj)
File
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py",
line 32, in __init__
super().__init__(process_obj)
File
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_fork.py",
line 19, in __init__
self._launch(process_obj)
File
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py",
line 47, in _launch
reduction.dump(process_obj, fp)
File
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/reduction.py",
line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle 'weakref' object
```
--
This message was sent by Atlassian Jira
(v8.3.4#803005)