-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
Environment details
- Specify the artifact at the beginning of the title. For example, "api-common", "gax" etc)
- OS type and version: Linux Debian 6.1.158-1 (2025-11-09) x86_64 GNU/Linux
- Java version: openjdk version "11.0.20.1" 2023-08-24
- artifact version(s): 2.63.1
Steps to reproduce
- Created a GCP API stub which uses "defaultHttpJsonTransportProviderBuilder" and creates an "InstantiatingHttpJsonChannelProvider"
- On the client close, the close is successfully but the executor service is not being deleted.
Code example
ManagedHttpJsonInterceptorChannel(
ManagedHttpJsonChannel channel, HttpJsonClientInterceptor interceptor) {
super();
this.channel = channel;
this.interceptor = interceptor;
}
@Override
public synchronized void shutdown() {
channel.shutdown();
}super() calls ManagedHttpJsonChannel which creates a fixed executor service that never gets deleted.
protected ManagedHttpJsonChannel() {
this(null, true, null, null);
}
private ManagedHttpJsonChannel(
Executor executor,
boolean usingDefaultExecutor,
String endpoint,
@Nullable HttpTransport httpTransport) {
this.executor = executor;
this.usingDefaultExecutor = usingDefaultExecutor;
this.endpoint = endpoint;
this.httpTransport = httpTransport == null ? new NetHttpTransport() : httpTransport;
this.deadlineScheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
}
Ideally we should call:
@Override
public synchronized void shutdown() {
super.shutdown();
channel.shutdown();
}
Same applies to shutdownNow(), close()
Metadata
Metadata
Assignees
Labels
No labels