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

docs: add FAQ/troubleshooting and operation timing guide #2434

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

lucix-aws
Copy link
Contributor

No description provided.

### How should I configure operation timeouts?

Much like the previous question, it depends. **The answer to this question,
however, should almost NEVER be based on pure empirical observation** - e.g. "I
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm i think if were going to make a fairly strong statement like this, we should provide an example of what an alternative configuration would look like thats not a pure empirical observation.

made 1000 calls to this operation, it took at most 5 seconds so I will set the
timeout based on that with a safety factor of 2x to 10 seconds". Environment
conditions can change and these types of assumptions can become wrong without
warning, leaving you open to the possibility of self-induced production pain.
Copy link
Contributor

@isaiahvita isaiahvita Dec 21, 2023

Choose a reason for hiding this comment

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

lol self-induced production pain might be a bit strongly negative for a public consumer-facing doc


We are unable to assist with extended or timed-out operation calls due to
extended HTTP round-trip times. An HTTP round-trip is defined as the time
between the first byte of the request being sent and the last byte of the
Copy link
Contributor

Choose a reason for hiding this comment

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

is it really the last byte? and not like time to first byte? i dont have any indication otherwise its just when i did a quick google search a couple of the top hits dont seem to specify exactly whether its time to first or last byte received.
https://www.cloudflare.com/learning/cdn/glossary/round-trip-time-rtt/
https://aws.amazon.com/what-is/rtt-in-networking/

do you happen to have a source on that? ideally something from the Go folks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For us it really depends on whether the response body is being forwarded, I'll try to clarify.

attempting to read the response.

This can occur for several reasons:
* You did not consume the response body for time after the response itself was
Copy link
Contributor

Choose a reason for hiding this comment

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

for time after grammar/phrasing seems off here

The SDK retries any errors matching the `connection reset` pattern by default.
However, this error can still occur in a context **outside** of the retry loop:
certain service operations directly forward the API's HTTP response body to the
caller to be consumed from the wire directly via `io.ReadCloser` (e.g.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: i think consumed from the wire directly may be more clarified if you contrasted it with the normal case

If you change it, be sure to change the signature of the function it returns as
well.

```
Copy link
Contributor

Choose a reason for hiding this comment

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

can you put go formatting here as well like the above formatted code


func timeSpan(ctx context.Context, name string, consumer func(string)) func() {
start := time.Now()
return func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

for my own curiosity, whats the advantage of using a higher-order function here? when it looks like all use cases in this code sample of where timeSpan is called, it immediately calls the returned function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not immediately called because of defer, I've clarified how it's used in a doc comment.

Copy link
Contributor

@isaiahvita isaiahvita Dec 21, 2023

Choose a reason for hiding this comment

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

i meant the second set of parentheses (i.e. the second invocation). the second invocation is called immediately after the first invocation. i understand the first invocation is delayed by defer.

but the comment clears it up, thanks.

@lucix-aws lucix-aws merged commit 3f11379 into documentation Dec 21, 2023
1 check passed
@lucix-aws lucix-aws deleted the doc-troubleshooting branch December 21, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants