Skip to content

fix(async-job): preserve async and stream failure types#994

Open
devin-ai-integration[bot] wants to merge 6 commits into
mainfrom
devin/1776776408-async-job-failure-type-propagation
Open

fix(async-job): preserve async and stream failure types#994
devin-ai-integration[bot] wants to merge 6 commits into
mainfrom
devin/1776776408-async-job-failure-type-propagation

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Apr 21, 2026

Summary

  • Preserve job-creation exceptions on placeholder async jobs so exhausted creation failures keep their original FailureType.
  • Aggregate wrapped async-job failures by precedence (config_error > transient_error > system_error) and include a deterministic failure-type breakdown in the internal message.
  • Preserve the aggregated inner FailureType when ConcurrentReadProcessor.is_done() raises the final concurrent read failure, instead of always wrapping failed streams as config_error.
  • Add regression coverage for job-creation 429/transient failures, async-job failure-type aggregation helpers, and concurrent stream transient failure propagation.
  • Fix CDK image build generation for Python connectors whose README.md is a symlink into Airbyte's shared connector docs but whose Docker build context omits that shared target.

Review & Testing Checklist for Human

  • Verify a connector with job-creation HTTP 429 now emits final async and concurrent aggregate failure_type=transient_error.
  • Confirm the failure precedence (config_error > transient_error > system_error) is the intended behavior for mixed stream/async failures.
  • Confirm the user-facing async-job aggregate messages remain acceptable aggregation keys and are not too narrow for non-auth config_error cases.
  • Re-run or review connector image checks for source-hardcoded-records and destination-motherduck; both failed before the image-build fix with entrypoint exit 127.
  • Confirm the retriggered Python 3.10 full pytest run is green; an unrelated-looking incremental cursor test failed once while Python 3.11/3.12/3.13 and local targeted reruns passed.

Notes

Local validation performed:

  • poetry run pytest unit_tests/sources/declarative/async_job/test_job_orchestrator.py unit_tests/sources/declarative/async_job/test_job.py unit_tests/sources/streams/concurrent/test_concurrent_read_processor.py -q
  • poetry run pytest unit_tests/sources/streams/concurrent/test_concurrent_read_processor.py -q
  • poetry run pytest -q 'unit_tests/sources/declarative/incremental/test_concurrent_perpartitioncursor.py::test_incremental_parent_state_no_incremental_dependency[test_incremental_parent_state-manifest0-mock_requests0-expected_records0-initial_state0-expected_state0-2]'
  • Three additional local reruns of that incremental cursor test passed.
  • poetry run ruff check .
  • poetry run ruff format --check .
  • poetry run mypy --config-file mypy.ini airbyte_cdk
  • poetry run mypy --config-file mypy.ini airbyte_cdk/sources/declarative/async_job/job.py airbyte_cdk/sources/declarative/async_job/job_orchestrator.py airbyte_cdk/utils/docker.py
  • poetry run mypy --config-file mypy.ini airbyte_cdk/exception_handler.py airbyte_cdk/sources/concurrent_source/concurrent_read_processor.py
  • Local image verification succeeded for source-hardcoded-records and destination-motherduck using the patched CDK image builder.

Full poetry run mypy --config-file mypy.ini airbyte_cdk initially failed locally because types-pytz was missing from the Poetry environment; rerunning with --install-types --non-interactive installed the stub package and the full mypy check passed.

Link to Devin session: https://app.devin.ai/sessions/fb20772ef207406d8c0fa12699a5fd2f
Requested by: Daryna Ishchenko (@darynaishchenko)

Replace hardcoded system_error in AsyncJobOrchestrator's aggregated failure with the highest-precedence FailureType among wrapped non-breaking exceptions (config_error > transient_error > system_error). The user-facing message is chosen per FailureType to stay deterministic; underlying failure-type counts and exception reprs are moved into internal_message.

Co-Authored-By: bot_apk <apk@cognition.ai>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This CDK Version

You can test this version of the CDK using the following:

# Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1776776408-async-job-failure-type-propagation#egg=airbyte-python-cdk[dev]' --help

# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1776776408-async-job-failure-type-propagation

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /prerelease - Triggers a prerelease publish with default arguments
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

PyTest Results (Fast)

4 073 tests  +14   4 062 ✅ +14   7m 41s ⏱️ -4s
    1 suites ± 0      11 💤 ± 0 
    1 files   ± 0       0 ❌ ± 0 

Results for commit da9c345. ± Comparison against base commit d3d1346.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

PyTest Results (Full)

4 076 tests  +14   4 064 ✅ +14   11m 27s ⏱️ +31s
    1 suites ± 0      12 💤 ± 0 
    1 files   ± 0       0 ❌ ± 0 

Results for commit da9c345. ± Comparison against base commit d3d1346.

♻️ This comment has been updated with latest results.

@darynaishchenko Daryna Ishchenko (darynaishchenko) marked this pull request as ready for review May 13, 2026 12:01
@devin-ai-integration devin-ai-integration Bot changed the title fix(async-job): propagate wrapped FailureType on async job aggregation fix(async-job): propagate wrapped failure type on async job aggregation May 13, 2026
Co-Authored-By: Daryna Ishchenko <darina.ishchenko17@gmail.com>
@devin-ai-integration devin-ai-integration Bot changed the title fix(async-job): propagate wrapped failure type on async job aggregation fix(async-job): preserve async and stream failure types May 18, 2026
Co-Authored-By: Daryna Ishchenko <darina.ishchenko17@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant