THRIFT-5454: add __setState__ function to TProcessPoolServer to enable correct multiprocessing behavior related to pickling
Client: Python
diff --git a/lib/py/src/server/TProcessPoolServer.py b/lib/py/src/server/TProcessPoolServer.py
index fe6dc81..d2e97c5 100644
--- a/lib/py/src/server/TProcessPoolServer.py
+++ b/lib/py/src/server/TProcessPoolServer.py
@@ -42,6 +42,11 @@
self.stopCondition = Condition()
self.postForkCallback = None
+ def __getstate__(self):
+ state=self.__dict__.copy()
+ state['workers'] = None
+ return state
+
def setPostForkCallback(self, callback):
if not callable(callback):
raise TypeError("This is not a callback!")