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

Only log outcome from client library retries to fallback hosts #79

Open
mattheworiordan opened this issue Jan 26, 2018 · 2 comments
Open

Comments

@mattheworiordan
Copy link
Member

mattheworiordan commented Jan 26, 2018

A customer has reported seeing timeouts in their logs and has therefore assumed publishes are failing with his client. However, this is not always the case as client libraries may have succeeded with the publish to an alternative endpoint.

We should consider adding a new spec item that states that when a request is retried by the client library, once the outcome is determined (success/failure), then the log entry should reflect what happened along with the final outcome. This should help to avoid ambiguity in the logs.

┆Issue is synchronized with this Jira Task by Unito

@mattheworiordan mattheworiordan changed the title Only log outcome from client library retries Only log outcome from client library retries to fallback hosts Apr 19, 2018
@mattheworiordan
Copy link
Member Author

I have now implemented this in Ruby as a convenience.

Example warnings emitted for a request that fails but then succeeds is now:

warn: Ably::Rest::Client - Retry 1 for get /time {} as initial attempt failed (seq #5g-tSQ): getaddrinfo: nodename nor servname provided, or not known (SocketError)
warn: Ably::Rest::Client - Request SUCCEEDED after 1 retry for get /time {} (seq #5g-tSQ, time elapsed 5.11s)

And a request that never succeeds:

warn: Ably::Rest::Client - Retry 1 for get /time {} as initial attempt failed (seq #KyefoA): getaddrinfo: nodename nor servname provided, or not known (SocketError)
warn: Ably::Rest::Client - Retry 2 for get /time {} as initial attempt failed (seq #KyefoA): getaddrinfo: nodename nor servname provided, or not known (SocketError)
error: Ably::Rest::Client - Request FAILED after 2 retries for get /time {} (seq #KyefoA, time elapsed 15.02s)

Note that:

  • I have included a sequence ID for the retries. This allows someone to filter through logs later and find the retries from one client. We could use request_id, but we don't yet support that, so I decided against that.
  • Success or failure conditions still log a result i.e. either way, the user knows when the retry sequence is over.

mattheworiordan referenced this issue in ably/ably-ruby Apr 30, 2018
Example warnings emitted for a request that fails but then succeeds is now:

```
warn: Ably::Rest::Client - Retry 1 for get /time {} as initial attempt failed (seq #5g-tSQ): getaddrinfo: nodename nor servname provided, or not known (SocketError)
warn: Ably::Rest::Client - Request SUCCEEDED after 1 retry for get /time {} (seq #5g-tSQ, time elapsed 5.11s)
```

And a request that never succeeds:

```
warn: Ably::Rest::Client - Retry 1 for get /time {} as initial attempt failed (seq #KyefoA): getaddrinfo: nodename nor servname provided, or not known (SocketError)
warn: Ably::Rest::Client - Retry 2 for get /time {} as initial attempt failed (seq #KyefoA): getaddrinfo: nodename nor servname provided, or not known (SocketError)
error: Ably::Rest::Client - Request FAILED after 2 retries for get /time {} (seq #KyefoA, time elapsed 15.02s)
```

See related https://github.com/ably/docs/issues/359
mattheworiordan referenced this issue in ably/ably-ruby May 1, 2018
Example warnings emitted for a request that fails but then succeeds is now:

```
warn: Ably::Rest::Client - Retry 1 for get /time {} as initial attempt failed (seq #5g-tSQ): getaddrinfo: nodename nor servname provided, or not known (SocketError)
warn: Ably::Rest::Client - Request SUCCEEDED after 1 retry for get /time {} (seq #5g-tSQ, time elapsed 5.11s)
```

And a request that never succeeds:

```
warn: Ably::Rest::Client - Retry 1 for get /time {} as initial attempt failed (seq #KyefoA): getaddrinfo: nodename nor servname provided, or not known (SocketError)
warn: Ably::Rest::Client - Retry 2 for get /time {} as initial attempt failed (seq #KyefoA): getaddrinfo: nodename nor servname provided, or not known (SocketError)
error: Ably::Rest::Client - Request FAILED after 2 retries for get /time {} (seq #KyefoA, time elapsed 15.02s)
```

See related https://github.com/ably/docs/issues/359
@QuintinWillison QuintinWillison transferred this issue from ably/docs Oct 3, 2022
@sync-by-unito
Copy link

sync-by-unito bot commented Oct 17, 2022

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-2824

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants