digitalbazaar / digitalbazaar/webkms-client

Where does retry logic belong in the webkms stack?

Open
#26 3 comments 0 reactions 3 assignees View on GitHub

@dmitrizagidulin is already working on this.

Since Jul 6, 2021.

question
Dominant language
JavaScript
Stars
6
Forks
4
PR merge metrics
No merged PRs in 30d

Description

If an HTTP timeout (specifically) occurs when interacting with the a KMS server, should a retry occur, and if so, at what layer of the stack should retry logic be implemented?

ky returned an error Request timed out by way of @digitalbazaar/http-client.

https://github.com/sindresorhus/ky#retry

ky does have some default retry capability, but note that POST is not a supported method by default. It appears to me that explicitly allowing a retry for the POST method on a kmsClient.verify call would be possible. The safety of doing this would need to be evaluated.

Triaging an HTTP timeout error in the bedrock-tokenizer stack led me here.

https://github.com/digitalbazaar/webkms-client/blob/main/KmsClient.js#L434-L436

The timeout occurred when hmac.verify was called on the hmac returned here:
https://github.com/digitalbazaar/bedrock-tokenizer/blob/master/lib/tokenizers.js#L200

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.