AnandInguva commented on code in PR #29542:
URL: https://github.com/apache/beam/pull/29542#discussion_r1410994215


##########
sdks/python/apache_beam/ml/transforms/handlers.py:
##########
@@ -134,7 +137,11 @@ def process(self, element):
         hash_object.update(str(list(value)).encode())
       else:  # assume value is a primitive that can be turned into str
         hash_object.update(str(value).encode())
-    yield (hash_object.hexdigest(), element)
+    unique_suffix = uuid.uuid4().hex
+    # over multpile docker containers, the uuid might generate
+    # same uuid. So we will add the process id to the hash key
+    # along with the unique suffix to avoid possible collisions.
+    yield (hash_object.digest() + str(os.getpid()) + unique_suffix, element)

Review Comment:
   Changed it. 



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