You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OkHttp gRPC sender retries are rejected by a bounded executor #8964
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
Build an OTLP gRPC exporter with retry enabled (the default) and setExecutorService(new ThreadPoolExecutor(1, 1, 0, TimeUnit.SECONDS, new SynchronousQueue<>())).
Point it at a closed localhost port.
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