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: adds option to increase rover's client timeout #838

Merged
merged 10 commits into from
Sep 23, 2021

Conversation

EverlastingBugstopper
Copy link
Contributor

@EverlastingBugstopper EverlastingBugstopper commented Sep 21, 2021

Fixes #792 by providing an option for configuring Rover's HTTP client timeout in seconds, and adding a new error code E031 for when HTTP(S) operations time out.

$ rover config whoami --client-timeout 0
Checking identity of your API key against the registry.
error[E031]: error sending request for url (https://graphql.api.apollographql.com/api/graphql): operation timed out

Caused by:
    operation timed out
              You can try increasing the timeout value by passing a higher value to the --client-timeout option.

From the docs attached to this PR (I'm not sure why Netlify didn't make a preview deploy... maybe because I didn't branch off of main?)


Increase the client timeout

Sometimes, you may want to make queries for large amounts of data that may take some extra time for the Studio API to process.

Rover supports increasing the client timeout in cases like this with the --client-timeout option, which takes a number of seconds as a parameter. By default, Rover will time out requests after 30 seconds.

@EverlastingBugstopper EverlastingBugstopper added the feature 🎉 new commands, flags, functionality, and improved error messages label Sep 21, 2021
@EverlastingBugstopper EverlastingBugstopper added this to the v0.3.0 milestone Sep 21, 2021
@EverlastingBugstopper EverlastingBugstopper self-assigned this Sep 21, 2021
Copy link
Contributor

@o0Ignition0o o0Ignition0o left a comment

Choose a reason for hiding this comment

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

Kudos again on the really great documentation! 🎉

src/cli.rs Show resolved Hide resolved
src/utils/client.rs Show resolved Hide resolved
crates/rover-client/src/blocking/client.rs Outdated Show resolved Hide resolved
crates/rover-client/src/error.rs Outdated Show resolved Hide resolved
src/utils/client.rs Outdated Show resolved Hide resolved
src/cli.rs Outdated Show resolved Hide resolved
src/error/metadata/suggestion.rs Outdated Show resolved Hide resolved
- cleans up request errors by properly assigning codes and suggestions
- local import for backoff crate
- const the cfg!(test) check
@EverlastingBugstopper
Copy link
Contributor Author

Thanks for the reviews all - appreciate the help, this already looks much better 😄

Base automatically changed from avery/insecure-tls to main September 23, 2021 20:41

## Increase the client timeout

Sometimes, you may want to make queries for large amounts of data that may take some extra time for the Studio API to process.
Copy link
Contributor

@StephenBarlow StephenBarlow Sep 23, 2021

Choose a reason for hiding this comment

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

Recommendation (feel free to adjust anything I've gotten a little wrong or you disagree with):

Increasing request timeouts

By default, Rover times out requests to the Apollo Studio API after 30 seconds. If you're executing a command that might take longer than 30 seconds to process, you can increase this timeout with the --client-timeout option:

rover lengthy command (whatever that would be) --client-timeout=60 # in seconds

@@ -246,3 +246,9 @@ Some build errors are part of normal workflows. For instance, you may need to pu

This error occurs when an operation check fails. This means that you proposed a schema that would break operations in use by existing clients. You can configure this behavior in the Checks -> Configuration view in [Apollo Studio](https://studio.apollographql.com/), and you can read more about client checks [here](https://www.apollographql.com/docs/studio/schema-checks/).

### E031

This error occurs when Rover made an HTTP(S) request and it timed out.
Copy link
Contributor

Choose a reason for hiding this comment

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

"made an HTTP request that timed out." <- I'm not too stressed about needing to include the (S)


This error occurs when Rover made an HTTP(S) request and it timed out.

The client timeout that Rover sets is configurable. You can try increasing the number of seconds Rover will wait to timeout with the `--client-timeout` flag, but it's also possible that you've made a request for too much data from the Studio API, or that the Studio API is experiencing degraded performance. You can check for the latter at our [status page](https://status.apollographql.com).
Copy link
Contributor

Choose a reason for hiding this comment

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

"You can increase Rover's request timeout, but it's also possible..."

"You can check for known performance issues on our status page"

Copy link
Contributor

Choose a reason for hiding this comment

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

That link would point to the new section in configuring.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🎉 new commands, flags, functionality, and improved error messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

graph check: operation timed out
4 participants