aws / aws-dax-go

AWS DAX SDK for the Go programming language. https://aws.amazon.com/dynamodb/dax
Apache License 2.0
47 stars 48 forks source link

Segreggating context errors #58

Open gauxs opened 1 month ago

gauxs commented 1 month ago

Overview:

Our DAX got latent and context started getting deadline exceeded. Below is the message which we were logging in our server: error ddb/de_entity_generic_get.go:99 couldn't get item {"id": "b1ace8e8-7f7a-4e44-af2a-4a4378ee1816", "table": "de-entity-map", "pk": "DE#9109356", "sk": "DE#9109356", "error": "RequestCanceled: request context canceled\ncaused by: context deadline exceeded”}

Breaking down the error log:

  1. context deadline exceeded - This is received from DAX server
  2. RequestCanceled: request context canceled - This is generated by aws-dax-go client.

We can see that the error log is misleading.

Description of changes:

ctx.Err() can return either Canceled or DeadlineExceeded, generating error message based on the error type.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.