liferoad commented on code in PR #35049:
URL: https://github.com/apache/beam/pull/35049#discussion_r2114190667


##########
sdks/python/apache_beam/metrics/cells.py:
##########
@@ -137,7 +138,11 @@ def update(self, value):
       # directly by circumventing the GIL.
       self.value += ivalue
     else:
-      with self._lock:
+      # If a container lock is provided, use it. Otherwise, use cell's own 
lock.

Review Comment:
   
https://github.com/apache/beam/pull/35049/files#diff-1293713097c11f7136aa69a2affccdd624a958dad8a10c68a4a31f39fa6c303dR281
 make sure the cells use the lock from the metrics container from what I can 
tell. I think 
https://github.com/apache/beam/pull/35049/files#diff-1293713097c11f7136aa69a2affccdd624a958dad8a10c68a4a31f39fa6c303dR342
 is probably more interesting to be reviewed. 
   
   I am not super confident about this PR in terms of testing this and the 
potential downside on the performance. 



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