You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "Abacn (via GitHub)" <gi...@apache.org> on 2024/10/31 21:14:32 UTC

[I] [Bug]: FnHarness.main not thread-safe on JvmInitializer calls [beam]

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: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: FnHarness.main not thread-safe on JvmInitializer calls [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #32990:
URL: https://github.com/apache/beam/issues/32990#issuecomment-3016666847

   This issue has been closed due to lack of activity. If you think that is incorrect, you can reopen the issue at any time.


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: FnHarness.main not thread-safe on JvmInitializer calls [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #32990: [Bug]: FnHarness.main not thread-safe on JvmInitializer calls
URL: https://github.com/apache/beam/issues/32990


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: FnHarness.main not thread-safe on JvmInitializer calls [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #32990:
URL: https://github.com/apache/beam/issues/32990#issuecomment-2919289266

   This issue has been marked as stale due to 150 days of inactivity. It will be closed in 30 days if no further activity occurs. If you think that’s incorrect or this issue still needs to be addressed, please simply write any comment. If closed, you can reopen the issue at any time. Thank you for your contributions.


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org