Skip to content

refactor(connectors): isolate per-connector init failures in runtime - #3244

Merged
hubcio merged 4 commits into
masterfrom
connectors-runtime
May 13, 2026
Merged

hubcio merged 4 commits into
masterfrom
connectors-runtime

Conversation

@mmodzelewski

Copy link
Copy Markdown
Member

Previously, any failure during connector init (path resolution,
dlopen, state load, plugin init, consumer/producer setup) was
propagated as a fatal RuntimeError and aborted the entire
runtime. A single bad config or missing plugin file took down
every other healthy connector with it, and the failing connector
was hidden from the API/health view since it never reached the
manager.

Capture per-connector failures inline against the offending
plugin and continue iterating. Connectors that fail before their
FFI container can be loaded are returned from sink::init /
source::init as FailedPlugin entries and surfaced through the
manager as ConnectorStatus::Error with the captured message in
last_error, so operators can still see and diagnose them.

The Result return is preserved on both init paths for symmetry
and future fatal-error handling, but no system-level errors are
currently emitted.

@mmodzelewski
mmodzelewski requested a review from spetz May 12, 2026 15:07
Previously, any failure during connector init (path resolution,
dlopen, state load, plugin init, consumer/producer setup) was
propagated as a fatal `RuntimeError` and aborted the entire
runtime. A single bad config or missing plugin file took down
every other healthy connector with it, and the failing connector
was hidden from the API/health view since it never reached the
manager.

Capture per-connector failures inline against the offending
plugin and continue iterating. Connectors that fail before their
FFI container can be loaded are returned from `sink::init` /
`source::init` as `FailedPlugin` entries and surfaced through the
manager as `ConnectorStatus::Error` with the captured message in
`last_error`, so operators can still see and diagnose them.

The `Result` return is preserved on both init paths for symmetry
and future fatal-error handling, but no system-level errors are
currently emitted.
@codecov

codecov Bot commented May 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.54448% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.19%. Comparing base (69177a1) to head (4da3aa5).

Files with missing lines Patch % Lines
core/connectors/runtime/src/sink.rs 83.51% 13 Missing and 2 partials ⚠️
core/connectors/runtime/src/source.rs 85.29% 13 Missing and 2 partials ⚠️
core/connectors/runtime/src/context.rs 93.84% 4 Missing ⚠️
core/connectors/runtime/src/main.rs 95.65% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3244       +/-   ##
=============================================
- Coverage     73.83%   51.19%   -22.64%     
  Complexity      943      943               
=============================================
  Files          1190     1188        -2     
  Lines        107833    94263    -13570     
  Branches      84850    71281    -13569     
=============================================
- Hits          79614    48257    -31357     
- Misses        25467    43471    +18004     
+ Partials       2752     2535      -217     
Components Coverage Δ
Rust Core 44.75% <87.54%> (-30.14%) ⬇️
Java SDK 60.14% <ø> (ø)
C# SDK 69.43% <ø> (ø)
Python SDK 81.43% <ø> (ø)
Node SDK 91.53% <ø> (ø)
Go SDK 39.80% <ø> (ø)
Files with missing lines Coverage Δ
core/connectors/runtime/src/main.rs 85.66% <95.65%> (+1.19%) ⬆️
core/connectors/runtime/src/context.rs 93.67% <93.84%> (+4.19%) ⬆️
core/connectors/runtime/src/sink.rs 79.86% <83.51%> (+7.46%) ⬆️
core/connectors/runtime/src/source.rs 77.41% <85.29%> (+9.33%) ⬆️

... and 307 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

spetz
spetz previously approved these changes May 12, 2026

@hubcio hubcio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall pr is sound but it's not tested well enough. only one failure mode is tested (the schema-level poll_interval = "not-a-valid-duration", which fails inside setup_sink_consumers). The other branches added by this refactor are not exercised:

  • resolve_plugin_path failure (e.g. path = "does-not-exist")
  • Container::load failure (e.g. valid path but not a dylib)
  • init_sink / init_source failure (plugin returns non-zero)
  • FileStateProvider::load failure for sources
  • the entire source side has no failure-isolation test

Comment thread core/connectors/runtime/src/sink.rs Outdated
@hubcio
hubcio merged commit 0cd1bec into master May 13, 2026
53 checks passed
@hubcio
hubcio deleted the connectors-runtime branch May 13, 2026 22:30
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.

4 participants