AMOOOMA commented on code in PR #37112:
URL: https://github.com/apache/beam/pull/37112#discussion_r2710160933


##########
sdks/python/apache_beam/utils/multi_process_shared.py:
##########
@@ -200,9 +226,99 @@ def __call__(self, *args, **kwargs):
   def __getattr__(self, name):
     return getattr(self._proxyObject, name)
 
+  def __setstate__(self, state):
+    self.__dict__.update(state)
+
+  def __getstate__(self):
+    return self.__dict__

Review Comment:
   by proxy on proxy I meant that first a MultiProcessShared object is created 
and the instance initialized inside it also try to create multiprocessshared 
objects. So for example like this test 
   
   ```
   class SimpleClass:
     def make_proxy(
         self, tag: str = 'proxy_on_proxy', spawn_process: bool = False):
       return multi_process_shared.MultiProcessShared(
           Counter, tag=tag, always_proxy=True,
           spawn_process=spawn_process).acquire()
   
   def test_proxy_on_proxy(self):
       shared1 = multi_process_shared.MultiProcessShared(
           SimpleClass, tag='proxy_on_proxy_main', always_proxy=True)
       instance = shared1.acquire()
       proxy_instance = instance.make_proxy()
       self.assertEqual(proxy_instance.increment(), 1)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to