You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "psobot (via GitHub)" <gi...@apache.org> on 2023/02/09 18:17:56 UTC

[GitHub] [beam] psobot opened a new issue, #25401: [Bug]: Python Beam does not fail a job if the main session was present could not be unpickled

psobot opened a new issue, #25401:
URL: https://github.com/apache/beam/issues/25401

   ### What happened?
   
   When launching a Beam pipeline in Python, the `--save_main_session` flag can be used to serialize the local session's state and load it on the workers. However, if the deserialization of this main session fails, the pipeline continues to execute - just without its global state, causing `NameError`s in various places. These `NameError` exceptions don't hint at the original root cause (which is that the main session state failed to deserialize, for whatever reason) which causes a large amount of confusion, especially for those unfamiliar with the intricacies of how Beam works under the hood.
   
   I resolved [a similar issue back in Beam 2.31](https://github.com/apache/beam/pull/14706) (https://github.com/apache/beam/pull/14706) that failed to stop a job if the main session was corrupted; this seems similar.
   
   Expected behaviour: if a main session is present but fails to deserialize, this is considered a "hard error" that stops the entire Beam job from running and forces the programmer to deal with the cause of the failure, rather than proceeding to run the job's code in a half-working state.
   
   ### Issue Priority
   
   Priority: 2 (default / most bugs should be filed as P2)
   
   ### Issue Components
   
   - [X] Component: Python SDK
   - [ ] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [ ] Component: IO connector
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Samza Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [X] 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


[GitHub] [beam] psobot commented on issue #25401: [Bug]: Python Beam does not fail a job if the main session was present could not be unpickled

Posted by "psobot (via GitHub)" <gi...@apache.org>.
psobot commented on issue #25401:
URL: https://github.com/apache/beam/issues/25401#issuecomment-1438756270

   I can put together a tiny repro, but in general this can be triggered by:
    - Creating a Python Beam pipeline that's a single script
    - Adding `import <any_third_party_module>` at the top of the script
    - Not including anything in `install_requires` in `setup.py`
    - Launching with `--save_main_session`


-- 
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


[GitHub] [beam] tvalentyn commented on issue #25401: [Bug]: Python Beam does not fail a job if the main session was present could not be unpickled

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on issue #25401:
URL: https://github.com/apache/beam/issues/25401#issuecomment-1441040099

   Got it, I don't think we need a repro, reproduction steps are clear. We can improve the logic https://github.com/apache/beam/blob/011296c14659f80c8ecbeefda79ecc3f1113bd95/sdks/python/apache_beam/runners/worker/sdk_worker_main.py#L125 and fail with an actionable error. I'll send a PR.


-- 
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


[GitHub] [beam] tvalentyn commented on issue #25401: [Bug]: Python Beam does not fail a job if the main session was present could not be unpickled

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on issue #25401:
URL: https://github.com/apache/beam/issues/25401#issuecomment-1435455316

   Thanks for reporting, sounds like a fixable usability issue. we should probably fail in this case, as long as  the main session is provided and not empty. Do you have a repro by chance?


-- 
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


[GitHub] [beam] tvalentyn closed issue #25401: [Bug]: Python Beam does not fail a job if the main session was present could not be unpickled

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn closed issue #25401: [Bug]: Python Beam does not fail a job if the main session was present could not be unpickled
URL: https://github.com/apache/beam/issues/25401


-- 
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