Skip to content

Commit

Permalink
Fix metadata processing threads leak in Big Query
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed May 14, 2024
1 parent 7e96167 commit b2dd150
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import static io.airlift.concurrent.Threads.daemonThreadsNamed;
import static io.airlift.configuration.ConditionalModule.conditionalModule;
import static io.airlift.configuration.ConfigBinder.configBinder;
import static io.trino.plugin.base.ClosingBinder.closingBinder;
import static io.trino.plugin.bigquery.BigQueryConfig.ARROW_SERIALIZATION_ENABLED;
import static java.util.concurrent.Executors.newFixedThreadPool;
import static java.util.stream.Collectors.toSet;
Expand Down Expand Up @@ -100,6 +101,8 @@ protected void setup(Binder binder)
newSetBinder(proxyBinder, BigQueryOptionsConfigurer.class).addBinding().to(ProxyOptionsConfigurer.class).in(Scopes.SINGLETON);
newOptionalBinder(binder, ProxyTransportFactory.class).setDefault().to(ProxyTransportFactory.DefaultProxyTransportFactory.class).in(Scopes.SINGLETON);
}));

closingBinder(binder).registerExecutor(ListeningExecutorService.class);
}

@Provides
Expand All @@ -117,6 +120,7 @@ public static BigQueryLabelFactory labelFactory(BigQueryConfig config)
}

@Provides
@Singleton
public ListeningExecutorService provideListeningExecutor(BigQueryConfig config)
{
return listeningDecorator(newFixedThreadPool(config.getMetadataParallelism(), daemonThreadsNamed("big-query-%s"))); // limit parallelism
Expand Down

0 comments on commit b2dd150

Please sign in to comment.