-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Break Python application with status 1 on exception #37390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Break Python application with status 1 on exception #37390
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
# We still raise at least one exception when a stream raises an exception because the platform currently relies | ||
# on a non-zero exit code to determine if a sync attempt has failed. We also raise the exception as a config_error | ||
# type because this combined error isn't actionable, but rather the previously emitted individual errors. | ||
raise AirbyteTracedException(message=error_message, internal_message="Concurrent read failure", failure_type=FailureType.config_error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a internal_message is different than abstract_source. I had to add an internal message as the scenario framework will assert on the internal_message. Leaving this empty would generate 'NoneType' object is not subscriptable
…s-code-not-equal-to-1
Your free trial has expired. To continue using Ellipsis, sign up at https://app.ellipsis.dev for $20/developer/month. If you have any questions, reach us at [email protected] |
airbyte-cdk/python/unit_tests/sources/streams/concurrent/test_concurrent_read_processor.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small comment about reusability, but not a blocker and I think this can go out sooner because its a critical fix
airbyte-cdk/python/airbyte_cdk/sources/concurrent_source/concurrent_read_processor.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the quick change!
What
To fail an attempt, the return code from the source should be != 0. Since the change to support partitioned state, this is not the case for Concurrent CDK. This change ensure that if there was an exception, we return status code 1.
How
If
ConcurrentReadProcessor
is done and there were exceptions, instead of returning "true", we raise an config_error like the abstract source does. The error needs to be a config_error to avoid paged alert.Review guide
airbyte-cdk/python/airbyte_cdk/sources/concurrent_source/concurrent_read_processor.py
airbyte-cdk/python/unit_tests/sources/streams/concurrent/test_concurrent_read_processor.py
The rest is updating the tests based on this new exception that is thrown
User Impact
This is unclear to me but my understanding based on discussion with @brianjlai is that we can have sync attempts that are classified as successful even though there were AirbyteTraceMessage of type system_error
Can this PR be safely reverted and rolled back?