Closed
Description
If a timeout is specified for NetHttpRequest, a singlethreadedexecutor is created.
https://github.com/googleapis/google-http-java-client/blob/master/google-http-client/src/main/java/com/google/api/client/http/javanet/NetHttpRequest.java#L184
This creates a new thread for every request which showed up as a 30% cpu increase issuing requests when writing to BigQuery from a Cloud Dataflow pipeline.
It seems that this cost could be reduced by using a cachedThreadPool, or by allowing the caller to inject an executorService to be used.