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

refactor: improve failover provider #43

Merged
merged 2 commits into from
Jan 7, 2025
Merged

Conversation

jtourkos
Copy link
Contributor

Hey! This implements events-processor#37

I've made the same changes to app, multiplayer and api projects. Let's review the changes here first and I'll apply the feedback to all the rest, keeping those PRs focused just on integrating this updated version.

Two main things we fixed:

  1. We now have proper logging so we can actually see what's happening with our providers - which one is being used, why it failed, if we switched to another one, etc.
  2. Fixed a bug where we weren't handling provider errors properly. We only checked for HTTP errors before, but a provider being "down" could also mean getting a 200 response with an RPC error in it. We handle both cases now.

Once this looks good, we should finally see clear logs telling us when we switch from Infura to Alchemy and why. This should help us understand what's actually happening in prod.

@jtourkos jtourkos requested a review from efstajas December 16, 2024 16:47
@jtourkos jtourkos linked an issue Dec 16, 2024 that may be closed by this pull request
Copy link

railway-app bot commented Dec 16, 2024

🚅 Previously deployed to Railway in the Drips App project. Environment has been deleted.

@railway-app railway-app bot temporarily deployed to events-processor-pr-43 December 16, 2024 16:48 Destroyed
src/core/FailoverJsonRpcProvider.ts Outdated Show resolved Hide resolved
src/core/FailoverJsonRpcProvider.ts Outdated Show resolved Hide resolved
@railway-app railway-app bot temporarily deployed to events-processor-pr-43 December 16, 2024 17:14 Destroyed
@jtourkos jtourkos merged commit 46ccb03 into main Jan 7, 2025
1 check passed
@jtourkos jtourkos deleted the improved-failover-provider branch January 7, 2025 08:43
@railway-app railway-app bot requested a deployment to multiplayer-pr-23 January 7, 2025 08:43 Abandoned
@railway-app railway-app bot requested a deployment to app-pr-1406 January 7, 2025 08:43 Abandoned
@railway-app railway-app bot requested a deployment to graphql-api-pr-43 January 7, 2025 08:43 Abandoned
@railway-app railway-app bot requested a deployment to app-pr-1381 January 7, 2025 08:43 Abandoned
@railway-app railway-app bot requested a deployment to app-pr-1402 January 7, 2025 08:43 Abandoned
@railway-app railway-app bot requested a deployment to search-sync-pr-2 January 8, 2025 11:27 Abandoned
@railway-app railway-app bot requested a deployment to graphql-api-pr-44 January 9, 2025 09:07 Abandoned
@railway-app railway-app bot requested a deployment to app-pr-1415 January 9, 2025 13:29 Abandoned
@railway-app railway-app bot requested a deployment to sprinkler-pr-9 January 10, 2025 11:29 Abandoned
@railway-app railway-app bot requested a deployment to search-sync-pr-4 January 10, 2025 14:47 Abandoned
@railway-app railway-app bot requested a deployment to app-pr-1416 January 13, 2025 02:04 Abandoned
@railway-app railway-app bot requested a deployment to graphql-api-pr-45 January 13, 2025 09:58 Abandoned
@railway-app railway-app bot requested a deployment to app-pr-1418 January 14, 2025 01:21 Abandoned
@railway-app railway-app bot requested a deployment to app-pr-1420 January 14, 2025 11:32 Abandoned
@railway-app railway-app bot requested a deployment to search-sync-pr-6 January 14, 2025 12:26 Abandoned
@railway-app railway-app bot requested a deployment to search-sync-pr-7 January 14, 2025 12:57 Abandoned
@railway-app railway-app bot requested a deployment to app-pr-1421 January 15, 2025 12:41 Abandoned
@railway-app railway-app bot requested a deployment to app-pr-1422 January 15, 2025 12:46 Abandoned
@railway-app railway-app bot requested a deployment to app-pr-1423 January 15, 2025 13:29 Abandoned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Fallback Provider
2 participants