Skip to content

Invalid gRPC response frame is logged without its exception #8625

Description

@thswlsqls

Describe the bug

OkHttpGrpcSender.handleResponse() discards the caught IOException when it fails to read the 5-byte gRPC frame header, so the log record carries no cause. Diagnostics only — the branch and the returned response are correct.

Steps to reproduce

Enable FINE logging for OkHttpGrpcSender and have the collector return a gRPC error response carrying grpc-status in the headers with an empty body. Reading the frame header throws EOFException; the emitted log record has no thrown field.

What did you expect to see?

The exception passed as the Throwable parameter, matching the two sibling catch blocks in the same method — line 214 ("Failed to read response body", e) and line 248 ("Failed to decompress response body", e):

logger.log(Level.FINE, "Invalid gRPC response frame", e);

What did you see instead?

OkHttpGrpcSender.java line 191 logs "Invalid gRPC response frame" with no cause.

What version and what artifacts are you using?

Artifacts: opentelemetry-exporter-sender-okhttp
Version: main @ b86f040
How did you reference these artifacts? N/A — built from source.

Environment

Compiler: Temurin 21
OS: N/A

Additional context

Introduced by #8224 (b665652), which added this branch and the compliant sibling in the same commit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions