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


##########
sdks/python/apache_beam/runners/worker/statesampler.py:
##########
@@ -156,7 +156,9 @@ def scoped_state(
         step_name=name_context.metrics_name(),
         io_target=io_target)
     if counter_name in self._states_by_name:
-      return self._states_by_name[counter_name]
+      state = self._states_by_name[counter_name]
+      state.set_metrics_container(metrics_container)

Review Comment:
   I'm quite skeptical about this change, as it mutates the metrics_container 
field on an existing ScopedState instance rather than keeping it immutable 
after creation.
   
   Have you tried running this new test on Prism without the `statesampler` 
change? I'm curious what behavior Prism exhibits here.



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