feat(serverless-hub) Added re-try logic to gcp calls #2111
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
GCP sometimes returns flaky errors when calling GCP
datastore
. This occurs when reading to and writing from the last used blocknumber for the monitor bot & normally produced the following error:The issue is currently discussed on GCP GitHub issues here: googleapis/nodejs-datastore#679
For now, this PR adds in a small change to the monitor hub to wrap the data retrieval and stage for the block number within re-try logic to try and mitigate this error. This is not a long term fix but aims to make the error less irritating in the interim until there is an official fix for GCP data store within GCP cloud run.
Summary
Adds
async-retry
logic to the datastore module.