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

feat: significantly increase timeout if GCF environment detected #300

Merged
merged 4 commits into from
Feb 24, 2020

Conversation

bcoe
Copy link
Contributor

@bcoe bcoe commented Feb 19, 2020

By eliminating caching, and creating a large number of concurrent requests, I was able
to create similar behavior to that described in #798. The root cause seems to be reduced
network performance when a function is initially deployed.

This PR detects a GCF runtime, based on environment variables, and significantly extends
network timeouts.


Based on testing, this should help mitigate the behavior in googleapis/google-auth-library-nodejs#798 (although the behavior of throttled network requests might still be unpredictable) and we probably close 798 until googleapis/gapic-generator-typescript#287 lands.

By eliminating caching, and creating a large number of concurrent requests, I was able
to create similar behavior to that described in #798. The root cause seems to be reduced
network performance when a function is initially deployed.

This PR detects a GCF runtime, based on environment variables, and significantly extends
network timeouts.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 19, 2020
src/index.ts Outdated Show resolved Hide resolved
test/index.test.ts Show resolved Hide resolved
test/index.test.ts Show resolved Hide resolved
@bcoe bcoe added the status: blocked Resolving the issue is dependent on other work. label Feb 19, 2020
Copy link
Contributor

@JustinBeckwith JustinBeckwith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not thrilled, but anything that gets us out of trouble is good. Do we have a way in place to measure how many times this happens? How will we know if this worked?

src/index.ts Outdated Show resolved Hide resolved
@bcoe bcoe removed the status: blocked Resolving the issue is dependent on other work. label Feb 22, 2020
@bcoe bcoe changed the title fix: signficantly increase timeout if GCF environment detected feat: significantly increase timeout if GCF environment detected Feb 22, 2020
@bcoe bcoe force-pushed the detect-runtime-extend-timeout branch from c110c70 to 244a670 Compare February 22, 2020 01:13
@bcoe bcoe merged commit 8e507c6 into master Feb 24, 2020
@stephenplusplus stephenplusplus deleted the detect-runtime-extend-timeout branch February 24, 2020 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants