tvalentyn commented on code in PR #32571:
URL: https://github.com/apache/beam/pull/32571#discussion_r1777890984


##########
sdks/python/apache_beam/transforms/core.py:
##########
@@ -2594,11 +2594,23 @@ def __getattribute__(self, name):
   def process(self, *args, **kwargs):
     if self._pool is None:
       self._pool = concurrent.futures.ThreadPoolExecutor(10)
+
+    # Import here to avoid circular dependency
+    from apache_beam.runners.worker.statesampler import get_current_tracker, 
set_current_tracker
+
+    # State sampler/tracker is stored as a thread local variable, and is used
+    # when incrementing counter metrics.
+    dispatching_thread_state_sampler = get_current_tracker()

Review Comment:
   can this code be in `__init__` instead of `process()` ?



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