Skip to content

OkHttp gRPC sender retries are rejected by a bounded executor #8964

Closed

Description

@thswlsqls

Describe the bug
Since #8854, OkHttpGrpcSender starts each retry by calling Call.enqueue() from inside the OkHttp callback of the failed attempt. That dispatcher thread is still busy, so with a bounded executor every retry is rejected and the export fails with InterruptedIOException: executor rejected instead of being retried.

Steps to reproduce

  1. Build an OTLP gRPC exporter with retry enabled (the default) and setExecutorService(new ThreadPoolExecutor(1, 1, 0, TimeUnit.SECONDS, new SynchronousQueue<>())).
  2. Point it at a closed localhost port.
  3. Export once.

What did you expect to see?
A retry after backoff, then the ConnectException. Before #8854, RetryInterceptor retried on the same thread, as OkHttpHttpSender and JdkHttpSender still do.

What did you see instead?
The retry fails with java.io.InterruptedIOException: executor rejected in OkHttpGrpcSender.sendAttempt() → enqueue() and never reaches the network.

What version and what artifacts are you using?
Artifacts: opentelemetry-exporter-otlp, opentelemetry-exporter-sender-okhttp
Version: 1.67.0 / main @ b32298a
How did you reference these artifacts? Gradle

Environment
Compiler: Temurin 21
OS: N/A

Additional context
I have a small fix that runs retries synchronously on the current thread. Happy to adjust if maintainers prefer a different execution model (e.g. a JdkHttpSender-style loop).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions