lukecwik commented on code in PR #22190:
URL: https://github.com/apache/beam/pull/22190#discussion_r921439703
##########
sdks/java/harness/jmh/src/main/java/org/apache/beam/fn/harness/jmh/control/ExecutionStateSamplerBenchmark.java:
##########
@@ -41,6 +41,16 @@
public class ExecutionStateSamplerBenchmark {
private static final String PTRANSFORM = "benchmarkPTransform";
+ @State(Scope.Thread)
+ public static class RunnersCoreStateTracker {
+ public ExecutionStateTracker tracker;
+
+ @Setup
+ public void setup(RunnersCoreStateSampler sharedState) {
+ tracker = new ExecutionStateTracker(sharedState.sampler);
+ }
+ }
+
@State(Scope.Benchmark)
public static class RunnersCoreStateSampler {
public final ExecutionStateSampler sampler =
ExecutionStateSampler.newForTest();
Review Comment:
I think these states need to be moved to RunnersCoreStateTracker like you
did for HarnessStateTracker.
We would only ever expect to have one thread activating/deactivating the
state. The race condition that you pointed out was between the sampling thread
and one (not many) processing thread.
--
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]