You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "mmmmxa (via GitHub)" <gi...@apache.org> on 2026/09/29 11:46:49 UTC

[PR] fix(connectors): propagate inner error messages in RuntimeError [iggy]

mmmmxa opened a new pull request, #4342:
URL: https://github.com/apache/iggy/pull/4342

   ## Which issue does this PR address?
   
   Relates to #4105
   
   ## Rationale
   
   Item 2 of the future work in #4105: when a sink fails to initialize because of an `IggyError`, the runtime logs only `Failed to set up sink consumers: Iggy error`, so the operator can't tell what went wrong (for example, a missing stream).
   
   ## What changed?
   
   `RuntimeError` variants wrapping `IggyError`, `ClientError`, `iggy_connector_sdk::Error` and `serde_json::Error` used fixed messages such as "Iggy error", which hid the inner cause from logs and from the connector's `last_error` in the HTTP API. These variants now use `#[error(transparent)]`, so the underlying message is surfaced.
   
   Unit tests cover each variant. An integration test starts the runtime with a sink pointing at a missing stream and asserts that `last_error` carries the server's reason while a healthy sibling sink keeps running.
   
   ## Local Execution
   
   - Passed
   - Pre-commit hooks ran
   
   ## AI Usage
   
   1. Claude Code (Claude Sonnet 5.5 model)
   2. All of the code was generated by the tool.
   3. Verified by careful manual review of the code and by running the tests locally.
   4. Yes, I can explain every line of the code.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(connectors): propagate inner error messages in RuntimeError [iggy]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #4342:
URL: https://github.com/apache/iggy/pull/4342#discussion_r4136244291


##########
core/connectors/runtime/src/error.rs:
##########
@@ -43,15 +43,15 @@ pub enum RuntimeError {
         connector_key: String,
         source: iggy_connector_sdk::Error,
     },
-    #[error("Iggy client error")]
+    #[error(transparent)]

Review Comment:
   simplification: `IggyClient` and `JsonError` have no production constructor: the runtime never calls `client_provider`, and no `serde_json` error reaches `RuntimeError`. Only the new tests at lines 118 and 146 build them, so delete both variants and those tests.



##########
core/integration/tests/connectors/runtime/error_isolation.rs:
##########
@@ -398,3 +399,48 @@ async fn given_sink_transform_error_when_batch_processed_should_not_count_filter
     );
     assert_eq!(sink.status, ConnectorStatus::Running);
 }
+
+#[iggy_harness(
+    server(connectors_runtime(
+        config_path = "tests/connectors/runtime/sink_missing_stream.toml"
+    )),
+    seed = seeds::connector_stream
+)]
+async fn given_sink_with_missing_stream_when_runtime_starts_should_expose_iggy_error_reason(
+    harness: &TestHarness,
+) {
+    let api_address = harness
+        .connectors_runtime()
+        .expect("connector runtime should be available")
+        .http_url();
+    let http_client = Client::new();
+
+    assert_runtime_healthy(&http_client, &api_address).await;
+    let sinks = fetch_sinks(&http_client, &api_address).await;
+
+    let missing_stream_sink = sinks
+        .iter()
+        .find(|sink| sink.key == "stdout_missing_stream")
+        .expect("Sink with a missing stream should be reported");
+    assert_eq!(missing_stream_sink.status, ConnectorStatus::Error);
+    let last_error = missing_stream_sink
+        .last_error
+        .as_ref()
+        .expect("Sink with a missing stream should expose a last_error");
+    assert!(
+        last_error.message.contains("no_such_stream")
+            && last_error.message.contains("was not found"),
+        "last_error should carry the Iggy server's reason, got: {}",

Review Comment:
   nit: The assert message credits the Iggy server for text the client builds. `IggyConsumer::init` builds `StreamNameNotFound` from the local `stream_id` (`consumer.rs:1027`), so call it the client error message.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(connectors): propagate inner error messages in RuntimeError [iggy]

Posted by "mmmmxa (via GitHub)" <gi...@apache.org>.
mmmmxa commented on PR #4342:
URL: https://github.com/apache/iggy/pull/4342#issuecomment-5894633309

   Hi @hubcio, I have changed the issue description. But I think it's a good idea to add a comment into the file too.
   May I ask you to run the review skill before I do that? So that all comments can be solved right away?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(connectors): propagate inner error messages in RuntimeError [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio merged PR #4342:
URL: https://github.com/apache/iggy/pull/4342


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(connectors): propagate inner error messages in RuntimeError [iggy]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #4342:
URL: https://github.com/apache/iggy/pull/4342#issuecomment-5890156213

   ## [Codecov](https://app.codecov.io/gh/apache/iggy/pull/4342?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 56.82%. Comparing base ([`9fdb642`](https://app.codecov.io/gh/apache/iggy/commit/9fdb64274c6b36dbb058713e66fd82f3b68bdf83?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`f6daf5d`](https://app.codecov.io/gh/apache/iggy/commit/f6daf5d1f20898cfd3630ec1ca65a8fa14d27f08?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             master    #4342       +/-   ##
   =============================================
   - Coverage     87.77%   56.82%   -30.96%     
     Complexity     1575     1575               
   =============================================
     Files          1288     1285        -3     
     Lines        227249   181662    -45587     
     Branches     190686   145099    -45587     
   =============================================
   - Hits         199478   103230    -96248     
   - Misses        23062    73788    +50726     
   + Partials       4709     4644       -65     
   ```
   
   | [Components](https://app.codecov.io/gh/apache/iggy/pull/4342/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [Rust Core](https://app.codecov.io/gh/apache/iggy/pull/4342/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `49.79% <100.00%> (-39.09%)` | :arrow_down: |
   | [Java SDK](https://app.codecov.io/gh/apache/iggy/pull/4342/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `68.68% <ø> (ø)` | |
   | [C# SDK](https://app.codecov.io/gh/apache/iggy/pull/4342/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.40% <ø> (ø)` | |
   | [Python SDK](https://app.codecov.io/gh/apache/iggy/pull/4342/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `91.00% <ø> (ø)` | |
   | [PHP SDK](https://app.codecov.io/gh/apache/iggy/pull/4342/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `85.67% <ø> (ø)` | |
   | [Node SDK](https://app.codecov.io/gh/apache/iggy/pull/4342/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `96.58% <ø> (ø)` | |
   | [Go SDK](https://app.codecov.io/gh/apache/iggy/pull/4342/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.28% <ø> (ø)` | |
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/iggy/pull/4342?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [core/connectors/runtime/src/error.rs](https://app.codecov.io/gh/apache/iggy/pull/4342?src=pr&el=tree&filepath=core%2Fconnectors%2Fruntime%2Fsrc%2Ferror.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9jb25uZWN0b3JzL3J1bnRpbWUvc3JjL2Vycm9yLnJz) | `79.54% <100.00%> (+35.79%)` | :arrow_up: |
   
   ... and [478 files with indirect coverage changes](https://app.codecov.io/gh/apache/iggy/pull/4342/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(connectors): propagate inner error messages in RuntimeError [iggy]

Posted by "mmmmxa (via GitHub)" <gi...@apache.org>.
mmmmxa commented on PR #4342:
URL: https://github.com/apache/iggy/pull/4342#issuecomment-5909466726

   Hi @hubcio, I've fixed everything


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(connectors): propagate inner error messages in RuntimeError [iggy]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4342:
URL: https://github.com/apache/iggy/pull/4342#issuecomment-5889630581

   <!-- iggy-pr-triage-welcome -->
   Thanks for the PR. It is labeled `S-waiting-on-review` and queued for review.
   
   Slash commands (own line, regular comment) move it around the queue:
   
   - `/ready` - back to `S-waiting-on-review` after addressing feedback
   - `/author` - flip to `S-waiting-on-author` while you finish changes
   - `/request-review @user-or-team` - request a reviewer
   - `/pin` - exempt the PR from the stale bot, `/unpin` to undo
   
   See [CONTRIBUTING.md](https://github.com/apache/iggy/blob/master/CONTRIBUTING.md#pr-triage-commands) for details.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(connectors): propagate inner error messages in RuntimeError [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on PR #4342:
URL: https://github.com/apache/iggy/pull/4342#issuecomment-5890263052

   thanks for this! two things i noticed:
   
   the description says `last_error` carries the server's reason, but in the test the text comes from the sdk. the consumer's `init()` gets `None` from `get_stream` and builds `StreamNameNotFound(name)` itself: https://github.com/apache/iggy/blob/9fdb64274c6b36dbb058713e66fd82f3b68bdf83/core/sdk/src/clients/consumer.rs#L1027
   
   errors that actually come from the server lose their fields on the wire (#3735, discussion in #3752). the client only reads the status code and fills the fields with defaults, so `last_error` will show the right error with zeroed ids, e.g. `Partition with ID: 0 for topic with ID: 0 ...`. can you fix the wording in the description and link #3735 there, so nobody reads those zeros as real ids?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(connectors): propagate inner error messages in RuntimeError [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on PR #4342:
URL: https://github.com/apache/iggy/pull/4342#issuecomment-5894766541

   /skill team-review-slim


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org