refactor(connectors): isolate per-connector init failures in runtime#3244
Open
mmodzelewski wants to merge 1 commit into
Open
refactor(connectors): isolate per-connector init failures in runtime#3244mmodzelewski wants to merge 1 commit into
mmodzelewski wants to merge 1 commit into
Conversation
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.
3b620dc to
4de954d
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3244 +/- ##
=============================================
- Coverage 73.82% 51.07% -22.76%
Complexity 943 943
=============================================
Files 1190 1188 -2
Lines 107832 94247 -13585
Branches 84849 71264 -13585
=============================================
- Hits 79606 48133 -31473
- Misses 25469 43570 +18101
+ Partials 2757 2544 -213
🚀 New features to boost your workflow:
|
spetz
approved these changes
May 12, 2026
hubcio
requested changes
May 13, 2026
Contributor
hubcio
left a comment
There was a problem hiding this comment.
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 on lines
+193
to
209
| fn build_failed_plugin( | ||
| id: u32, | ||
| key: &str, | ||
| name: &str, | ||
| config: &SinkConfig, | ||
| error: String, | ||
| ) -> FailedPlugin { | ||
| FailedPlugin { | ||
| id, | ||
| key: key.to_owned(), | ||
| name: name.to_owned(), | ||
| path: config.path.clone(), | ||
| config_format: config.plugin_config_format, | ||
| error, | ||
| enabled: config.enabled, | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
this looks like FailedPlugin::new().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, any failure during connector init (path resolution,
dlopen, state load, plugin init, consumer/producer setup) was
propagated as a fatal
RuntimeErrorand aborted the entireruntime. 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::initasFailedPluginentries and surfaced through themanager as
ConnectorStatus::Errorwith the captured message inlast_error, so operators can still see and diagnose them.The
Resultreturn is preserved on both init paths for symmetryand future fatal-error handling, but no system-level errors are
currently emitted.