claudevdm commented on PR #35063:
URL: https://github.com/apache/beam/pull/35063#issuecomment-2940260757

   I tested a variation where we add a new tracker
   
   ```
   _DYNAMIC_CLASS_STATE_SET_TRACKER = set()
   ...
   def _class_setstate(obj, state):
       with _DYNAMIC_CLASS_TRACKER_LOCK:
           tracker_id = _DYNAMIC_CLASS_TRACKER_BY_CLASS.get(obj)
           if tracker_id is not None:
               if tracker_id in _DYNAMIC_CLASS_STATE_SET_TRACKER:
                 return obj
               _DYNAMIC_CLASS_STATE_SET_TRACKER.add(tracker_id)
   ```
   
   The only test that fails with this approach is 
tests/cloudpickle_test.py::CloudPickleTest::test_interactive_dynamic_type_and_stored_remote_instances
 which is expected
   
   
   test_interactive_dynamic_type_and_stored_remote_instances simulates monkey 
patching a type in the local process after pickling to ensure that remote 
processes use the updated state.
   
   
https://github.com/cloudpipe/cloudpickle/blob/c025de75715cd2f22f650d1b4bbb8559e8eaac46/tests/cloudpickle_test.py#L2022
   
   I do not think we rely on this "mokey patch should update remote class def" 
behavior in apache beam. 


-- 
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