Skip to content

feat: update fred to 10.1, add timeouts and connection health checks #7354

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

Closed
wants to merge 3 commits into from

Conversation

aembke
Copy link
Contributor

@aembke aembke commented Apr 28, 2025

  • Update fred to 10.1.0
  • Adds some configuration options to improve client resiliency under various failure modes (TCP failures and timeouts, unresponsive sockets, Redis server failures, etc)
  • Adds heartbeats (sending PING every 10 sec) to each client in the pool
  • Refactor client initialization

Notes:

  • Fred v10 has significantly improved write throughput vs v9, but I didn't add any specific tests or benchmarks in this repo related to benchmarking. Let me know if you'd like to see that added though.
  • This PR removes the timeout on wait_for_connect in RedisCacheStorage::create_client. The internal_command_timeout and unresponsive config fields should handle timeouts on connection creation, so hopefully that's not necessary. If you find you still need that timeout please let me know, I'd consider that a bug in the client.
  • The heartbeat logic will currently break out of the sleep loop when it encounters an error. This might reduce the usefulness of the feature overall, but the other configuration changes should catch any underlying connection issues regardless. A better solution would be to set break_on_error to false, but that likely conflicts with the custom Drop impl that's used on the pool. I think longer term I'll change the Pool impl so it automatically closes connections when the last Pool is dropped so you all don't have to do that here, and then you should be able to just change that arg to false without any other compensating changes.

Fixes #6855


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Tests added and passing3
    • Unit Tests
    • Integration Tests
    • Manual Tests

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@aembke aembke requested a review from a team as a code owner April 28, 2025 17:32
@apollo-cla
Copy link

@aembke: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Apr 28, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 9a845d17ee96c9495d87e1d6

@abernix
Copy link
Member

abernix commented Apr 28, 2025

Thanks for opening this! Just as a heads-up, your CI tests may somewhat expectedly fail (beyond just the lint step, which I see you've already fixed) due to the contributor workflow and the reliance on an Enterprise license which is not available in CI runs that initiate from forks (due to environment variable secret availability). If you're able to get tests passing locally though, that'll be the best leading indicator of eventual success on that front. As the PR progresses through review, the Router Core team will take things over. 😄

I'll get this on the team's radar.

@abernix
Copy link
Member

abernix commented May 22, 2025

We've copied this to #7526 and that seems pretty close to merging. When it does, this PR will automatically close. @aembke Thank you so much for opening this. We've preserved your contribution credit on the commits we pulled over to the other PR. 🙌

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.

Redis connection and connection pool maintainance (TCP keepalive, redis ping)
4 participants