Github user BryanCutler commented on a diff in the pull request:
https://github.com/apache/spark/pull/18695#discussion_r130511618
--- Diff: python/pyspark/tests.py ---
@@ -858,6 +858,49 @@ def test_multiple_broadcasts(self):
self.assertEqual(N, size)
self.assertEqual(checksum, csum)
+ def test_multithread_broadcast_pickle(self):
+ import threading
+
+ b1 = self.sc.broadcast(list(range(3)))
+ b2 = self.sc.broadcast(list(range(3)))
+
+ def f1():
+ return b1.value
+
+ def f2():
+ return b2.value
+
+ funcs_num_pickled = {f1: None, f2: None}
+
+ def do_pickle(f, sc):
+ command = (f, None, sc.serializer, sc.serializer)
+ ser = CloudPickleSerializer()
+ ser.dumps(command)
+
+ def process_vars(sc):
+ broadcast_vars = [x for x in sc._pickled_broadcast_vars]
+ num_pickled = len(broadcast_vars)
+ sc._pickled_broadcast_vars.clear()
--- End diff --
yeah, that would be good
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]