Skip to content

fix(connectors): log underlying errors instead of discarding them in SDK poll/consume paths#3200

Open
atharvalade wants to merge 1 commit intoapache:masterfrom
atharvalade:fix/connector-sdk-log-poll-errors
Open

fix(connectors): log underlying errors instead of discarding them in SDK poll/consume paths#3200
atharvalade wants to merge 1 commit intoapache:masterfrom
atharvalade:fix/connector-sdk-log-poll-errors

Conversation

@atharvalade
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #3171

Rationale

Silent error swallowing in connector SDK made debugging connector failures nearly impossible — only generic "Failed to poll/consume" messages appeared with zero root-cause context.

What changed?

The source SDK's handle_messages loop discarded the Err variant from source.poll() and postcard::to_allocvec, logging only a static string. The sink SDK had the same pattern across all postcard::from_bytes deserialization calls, try_into_payload, and sink.consume() (which wasn't logged at all).

All let Ok(x) = expr else { ... } patterns are replaced with match to bind and format the underlying error into the existing log lines. No behavioral change — same control flow (continue/return codes) — just makes the root cause visible.

Local Execution

  • Passed / passed
  • Pre-commit hooks ran / ran (cargo fmt --check, cargo clippy, trailing-whitespace, trailing-newline, license-headers all green)

AI Usage

  1. Opus 4.6
  2. used to locate the pattern and write the match arms
  3. Verified via cargo clippy, cargo fmt --check, and full CI script suite locally
  4. Yes, all code can be explained

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 55.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.33%. Comparing base (611fca0) to head (d8eee3f).

Files with missing lines Patch % Lines
core/connectors/sdk/src/sink.rs 50.00% 15 Missing ⚠️
core/connectors/sdk/src/source.rs 70.00% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3200       +/-   ##
=============================================
- Coverage     74.10%   58.33%   -15.77%     
  Complexity      943      943               
=============================================
  Files          1159     1158        -1     
  Lines        102033    91926    -10107     
  Branches      79083    68976    -10107     
=============================================
- Hits          75607    53623    -21984     
- Misses        23765    35723    +11958     
+ Partials       2661     2580       -81     
Components Coverage Δ
Rust Core 54.21% <55.00%> (-21.12%) ⬇️
Java SDK 60.14% <ø> (ø)
C# SDK 69.38% <ø> (ø)
Python SDK 81.43% <ø> (ø)
Node SDK 91.53% <ø> (ø)
Go SDK 39.43% <ø> (ø)
Files with missing lines Coverage Δ
core/connectors/sdk/src/source.rs 81.94% <70.00%> (+16.23%) ⬆️
core/connectors/sdk/src/sink.rs 75.75% <50.00%> (-1.07%) ⬇️

... and 245 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.

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.

Connector SDK silently swallows poll errors

1 participant