shunping commented on code in PR #38501:
URL: https://github.com/apache/beam/pull/38501#discussion_r3253434919


##########
sdks/python/apache_beam/utils/subprocess_server.py:
##########
@@ -78,13 +78,14 @@ def __init__(self, constructor, destructor):
     self._counter = 0
 
   def _next_id(self):
-    with self._lock:
-      self._counter += 1
-      return self._counter
+    # Caller must hold self._lock.
+    self._counter += 1
+    return self._counter

Review Comment:
   It is only used in register() and a similar pattern has been used in other 
code too: https://github.com/search?q=repo%3Aapache%2Fbeam%20_next_id&type=code



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