Skip to content

Log the exception when a gRPC response frame is invalid#8626

Draft
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/okhttp-grpc-invalid-frame-log-throwable
Draft

Log the exception when a gRPC response frame is invalid#8626
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/okhttp-grpc-invalid-frame-log-throwable

Conversation

@thswlsqls

@thswlsqls thswlsqls commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #8625

Description

  • OkHttpGrpcSender.handleResponse() caught the IOException from reading the 5-byte gRPC frame header but logged only a message, dropping the cause. The two sibling catch blocks in the same method already pass it ("Failed to read response body", e and "Failed to decompress response body", e).
  • Diagnostics-only, no behavior change: the branch, the returned response, and the log message string are unchanged — the log record just gains its thrown field.
  • A gRPC error response with grpc-status in the headers and an empty body reaches this branch via EOFException.
  • Introduced by Response body bounds #8224 (b665652), which added this branch and the compliant sibling in the same commit.

Testing done

  • No test added: nothing observable changes, and no existing test asserts this log record.
  • ./gradlew :exporters:sender:okhttp:check — 42 tests passed.
  • No apidiff or CHANGELOG entry: io.opentelemetry.exporter.sender.okhttp.internal is internal and the change is not user-facing.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.60%. Comparing base (b86f040) to head (70c6836).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8626   +/-   ##
=========================================
  Coverage     91.60%   91.60%           
  Complexity    10343    10343           
=========================================
  Files          1013     1013           
  Lines         27352    27352           
  Branches       3215     3215           
=========================================
  Hits          25057    25057           
  Misses         1567     1567           
  Partials        728      728           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Invalid gRPC response frame is logged without its exception

1 participant