psobot commented on code in PR #25617:
URL: https://github.com/apache/beam/pull/25617#discussion_r1116347349
##########
sdks/python/apache_beam/runners/worker/sdk_worker_main.py:
##########
@@ -120,9 +121,17 @@ def create_harness(environment, dry_run=False):
'Could not load main session: %s', exception_details, exc_info=True)
raise
Review Comment:
Would it also be useful to set `deferred_exception` here instead raising
this `CorruptMainSessionException` directly?
##########
sdks/python/apache_beam/runners/worker/sdk_worker_main.py:
##########
@@ -120,9 +121,17 @@ def create_harness(environment, dry_run=False):
'Could not load main session: %s', exception_details, exc_info=True)
raise
except Exception: # pylint: disable=broad-except
+ summary = (
+ "Could not load main session. Inspect which external dependencies "
+ "are used in the main module of your pipeline. Verify that "
+ "corresponding packages are installed in the pipeline runtime "
+ "environment and their installed version match the versions used in "
+ "pipeline submission environment. For more information, see:
https://"
+ "beam.apache.org/documentation/sdks/python-pipeline-dependencies/")
+ _LOGGER.error(summary, exc_info=True)
exception_details = traceback.format_exc()
- _LOGGER.error(
- 'Could not load main session: %s', exception_details, exc_info=True)
+ deferred_exception = CorruptMainSessionException(
Review Comment:
Not sure if `CorruptMainSessionException` is the best exception type to use
here, as the main session file isn't actually corrupted in this case. Would
`ImportError` be appropriate?
```suggestion
deferred_exception = ImportError(
```
--
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]