Abacn opened a new issue, #32990: URL: https://github.com/apache/beam/issues/32990
### 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 https://github.com/apache/beam/blob/d3a841c100dd91f8daebd18bd807cfe438b6b988/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnHarness.java#L400 https://github.com/apache/beam/blob/d3a841c100dd91f8daebd18bd807cfe438b6b988/sdks/java/core/src/main/java/org/apache/beam/sdk/util/common/ReflectHelpers.java#L197 - 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 https://github.com/apache/beam/issues/30512#issuecomment-2441997749 ### Issue Priority Priority: 2 (default / most bugs should be filed as P2) ### Issue Components - [ ] Component: Python SDK - [ ] Component: Java SDK - [ ] Component: Go SDK - [ ] Component: Typescript SDK - [ ] Component: IO connector - [ ] Component: Beam YAML - [ ] Component: Beam examples - [ ] Component: Beam playground - [ ] Component: Beam katas - [ ] Component: Website - [ ] Component: Infrastructure - [ ] Component: Spark Runner - [ ] Component: Flink Runner - [ ] Component: Samza Runner - [ ] Component: Twister2 Runner - [ ] Component: Hazelcast Jet Runner - [ ] Component: Google Cloud Dataflow Runner -- 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]
