We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ccd1d7 commit 41c3657Copy full SHA for 41c3657
1 file changed
sdks/python/apache_beam/runners/worker/statesampler_fast.pyx
@@ -153,9 +153,13 @@ cdef class StateSampler(object):
153
self.sampling_thread.join()
154
155
def reset(self):
156
- for state in self.scoped_states_by_index:
157
- (<ScopedState>state)._nsecs = 0
158
- self.started = self.finished = False
+ pythread.PyThread_acquire_lock(self.lock, pythread.WAIT_LOCK)
+ try:
+ for state in self.scoped_states_by_index:
159
+ (<ScopedState>state)._nsecs = 0
160
+ self.started = self.finished = False
161
+ finally:
162
+ pythread.PyThread_release_lock(self.lock)
163
164
cpdef ScopedState current_state(self):
165
return self.current_state_c()
0 commit comments