Skip to content

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

Merged

Conversation

maxi297
Copy link
Contributor

@maxi297 maxi297 commented Apr 18, 2024

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

  1. airbyte-cdk/python/airbyte_cdk/sources/concurrent_source/concurrent_read_processor.py
  2. 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?

  • YES 💚
  • NO ❌

Copy link

vercel bot commented Apr 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs 🛑 Canceled (Inspect) Apr 18, 2024 11:24pm

@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Apr 18, 2024
Base automatically changed from maxi297/fix_partitioned_state_saving_issue to master April 18, 2024 02:57
# 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)
Copy link
Contributor Author

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

@maxi297 maxi297 marked this pull request as ready for review April 18, 2024 12:54
@maxi297 maxi297 requested a review from a team April 18, 2024 12:54
Copy link

ellipsis-dev bot commented Apr 18, 2024

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]

Copy link
Contributor

@brianjlai brianjlai left a 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

Copy link
Contributor

@brianjlai brianjlai left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants