Skip to content

Conversation

@alecsavvy
Copy link
Contributor

Description

Adds retry logic to some of relay's operations, not sure this will fix the specific issue with the fluctuating chain health but it'll help with chain restarts and connectivity errors.

How Has This Been Tested?

audius-cmd test

@alecsavvy alecsavvy requested a review from schottra August 9, 2024 00:49
@alecsavvy alecsavvy self-assigned this Aug 9, 2024
@changeset-bot
Copy link

changeset-bot bot commented Aug 9, 2024

⚠️ No Changeset found

Latest commit: f83074c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

return e instanceof Error ? e : new Error(String(e))
}

export const retryPromise = async <T>(task: () => Promise<T>, retries = 128): Promise<T> => {
Copy link
Contributor

Choose a reason for hiding this comment

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

128 seems...a bit high? 😅
Especially if the timeout between is half a second. This is going to probably exceed the HTTP timeout from most clients.
I think 3 times is the standard for most of the client code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we use 128 for the confirmations as well but yeah, i can lower the intensity a bit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we do want it longer than the container restarts which are something like 30s iirc

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see. Carry on, then!

@alecsavvy alecsavvy enabled auto-merge (squash) August 9, 2024 18:33
@alecsavvy alecsavvy merged commit b7b8cd0 into main Aug 9, 2024
@alecsavvy alecsavvy deleted the as/relay-server-retries branch August 9, 2024 18:54
schottra added a commit that referenced this pull request Aug 13, 2024
…ts-round-2

* origin/main: (43 commits)
  Testnet configuration for cometbft core (#9421)
  Fix pagination args (#9425)
  [QA-1501] Fix mobile search input (#9426)
  Add paginations to comments API (#9407)
  [C-4932] Add CommentBody component to harmony and harmony-native (#9415)
  Audius Client (Web and Mobile) v1.5.94
  check is_custom_musical_key before pulling in calculated key in repairer (#9417)
  Set is_custom_musical_key (#9418)
  add is_custom_musical_key (#9416)
  fix repairer eager loading (#9414)
  [PAY-3332] Remixers users endpoint (#9401)
  clean up aa endpts and limit ffprobe fields (#9413)
  relay retries (#9410)
  Audius Protocol v0.6.166
  [QA-1459] Fix 0087_fix_slugs_with_slash.sql migration (#9411)
  [QA-1491] Fix balance polling bug (#9402)
  Fix lint (#9412)
  [QA-1356] Improve notification UI (#9390)
  Fix useClickOutside (#9409)
  Add better error messages for Claimable Tokens Program (#9369)
  ...
audius-infra pushed a commit that referenced this pull request Aug 13, 2024
[06ee8a1] Fix pagination args (#9425) Isaac Solo
[f7dad77] Add paginations to comments API (#9407) Isaac Solo
[dd7b490] check is_custom_musical_key before pulling in calculated key in repairer (#9417) Michelle Brier
[ee99fd4] add is_custom_musical_key (#9416) Michelle Brier
[91d5c6f] fix repairer eager loading (#9414) Michelle Brier
[f30a637] [PAY-3332] Remixers users endpoint (#9401) Reed
[cc77d13] clean up aa endpts and limit ffprobe fields (#9413) Michelle Brier
[b7b8cd0] relay retries (#9410) alecsavvy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants