Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set a higher MaxIdleConnsPerHost for idtoken client #1744

Closed
david-gang opened this issue Nov 8, 2022 · 2 comments · Fixed by #1754
Closed

How to set a higher MaxIdleConnsPerHost for idtoken client #1744

david-gang opened this issue Nov 8, 2022 · 2 comments · Fixed by #1754
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@david-gang
Copy link

david-gang commented Nov 8, 2022

Thanks for stopping by to ask us a question! Please make sure to include:

  • What you're trying to do

set a higher MaxIdleConnsPerHost for idtoken client in order to get a better latency

  • What code you've already tried
httpTransport := http.DefaultTransport.(*http.Transport).Clone()
	httpTransport.MaxIdleConnsPerHost = 100
	baseClient := http.Client{
		Transport: httpTransport,
	}
client, err := idtoken.NewClient(ctx, aud, option.WithHTTPClient(&baseClient))
  • Any error messages you're getting

transport/http: WithHTTPClient passed to NewTransport

The problem is similar to here:

#1074

but the solution does not look applicable as i have no real access to the transport here.

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

@david-gang david-gang added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Nov 8, 2022
@codyoss codyoss assigned quartzmo and unassigned codyoss Nov 8, 2022
@quartzmo
Copy link
Member

Hi @david-gang,

Regarding your sample:

client, err := idtoken.NewClient(ctx, aud, option.WithHTTPClient(&baseClient))

It seems clear from the error that option.WithHTTPClient (or idtoken.WithHTTPClient) is not meant to be used with idtoken.NewClient. I think that in idtoken it is possibly only meant to be used with idtoken.NewValidator.

Is this a feature request to add MaxIdleConnsPerHost as an option?

@david-gang
Copy link
Author

Thanks @quartzmo !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants