mirror of https://github.com/grpc/grpc-java.git
xds: mark Sds-Ssl threadfactory daemon to allow apps to exit (#6608)
This commit is contained in:
parent
cf89b4b53d
commit
1b5d61f18f
|
|
@ -19,6 +19,7 @@ package io.grpc.xds.sds;
|
|||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import io.envoyproxy.envoy.api.v2.auth.UpstreamTlsContext;
|
||||
import io.grpc.xds.Bootstrapper;
|
||||
import io.grpc.xds.sds.ReferenceCountingSslContextProviderMap.SslContextProviderFactory;
|
||||
|
|
@ -45,7 +46,10 @@ final class ClientSslContextProviderFactory
|
|||
return SdsSslContextProvider.getProviderForClient(
|
||||
upstreamTlsContext,
|
||||
Bootstrapper.getInstance().readBootstrap().getNode(),
|
||||
Executors.newSingleThreadExecutor(),
|
||||
Executors.newSingleThreadExecutor(new ThreadFactoryBuilder()
|
||||
.setNameFormat("client-sds-sslcontext-provider-%d")
|
||||
.setDaemon(true)
|
||||
.build()),
|
||||
/* channelExecutor= */ null);
|
||||
} catch (IOException ioe) {
|
||||
throw new RuntimeException(ioe);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package io.grpc.xds.sds;
|
|||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import io.envoyproxy.envoy.api.v2.auth.DownstreamTlsContext;
|
||||
import io.grpc.xds.Bootstrapper;
|
||||
import io.grpc.xds.sds.ReferenceCountingSslContextProviderMap.SslContextProviderFactory;
|
||||
|
|
@ -46,7 +47,10 @@ final class ServerSslContextProviderFactory
|
|||
return SdsSslContextProvider.getProviderForServer(
|
||||
downstreamTlsContext,
|
||||
Bootstrapper.getInstance().readBootstrap().getNode(),
|
||||
Executors.newSingleThreadExecutor(),
|
||||
Executors.newSingleThreadExecutor(new ThreadFactoryBuilder()
|
||||
.setNameFormat("server-sds-sslcontext-provider-%d")
|
||||
.setDaemon(true)
|
||||
.build()),
|
||||
/* channelExecutor= */ null);
|
||||
} catch (IOException ioe) {
|
||||
throw new RuntimeException(ioe);
|
||||
|
|
|
|||
Loading…
Reference in New Issue