You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FnHarness.main usually started from a fresh jvm on worker. However, there is also an EmbeddedEnvironmentFactory that creates an environment where FnHarness is embedded, as a result a single JVM is used. This becomes a problem when running various pipelines at the same time, like in a gradle test task:
A suspected racing condition:
Pipeline A loaded some java class at runtime
Pipeline B execution startup, in JvmInitializers.beforeProcessing, gathered all JvmInitializers implementations
Pipeline A clean up, removed those classes from temp dir
Pipeline B trying to fetch those class instances from ServiceLoader, however they are gone
In general, the JvmInitializer mechanism did not consider the scenario of embedded FnHarness. Running multiple tests in parallel using portable runner "initializes" jvm each time a FnHarness started.
What happened?
FnHarness.main usually started from a fresh jvm on worker. However, there is also an EmbeddedEnvironmentFactory that creates an environment where FnHarness is embedded, as a result a single JVM is used. This becomes a problem when running various pipelines at the same time, like in a gradle test task:
A suspected racing condition:
Pipeline A loaded some java class at runtime
Pipeline B execution startup, in JvmInitializers.beforeProcessing, gathered all JvmInitializers implementations
beam/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnHarness.java
Line 400 in d3a841c
beam/sdks/java/core/src/main/java/org/apache/beam/sdk/util/common/ReflectHelpers.java
Line 197 in d3a841c
Pipeline A clean up, removed those classes from temp dir
Pipeline B trying to fetch those class instances from ServiceLoader, however they are gone
In general, the JvmInitializer mechanism did not consider the scenario of embedded FnHarness. Running multiple tests in parallel using portable runner "initializes" jvm each time a FnHarness started.
This causes #30512 (comment)
Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
Issue Components
The text was updated successfully, but these errors were encountered: