question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

proposal: [apollo-datasource-rest] - bypass redis cache while redis host is not reachable

See original GitHub issue

If Redis host is down, i.e. not reachable, the query response gets this error:

 "message": "Reached the max retries per request limit (which is 3). Refer to \"maxRetriesPerRequest\" option for details."

redis-down

However, I think that showing this kind of error should be avoided and the default response’s flow should be granted.

In https://github.com/apollographql/apollo-server/blob/master/packages/apollo-datasource-rest/src/HTTPCache.ts line 38 will assign the ioredis’ error to entry.

...
const entry = await this.keyValueCache.get(cacheKey);
    if (!entry) {
      const response = await this.httpFetch(request);
      ...

I guess entry should be null in that case so that const response = await this.httpFetch(request); can be executed if redis’ host is down.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:14
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
ecerronicommented, Feb 10, 2020

@geraldstrobl Nope, no PR.

This issue is been waiting for a response from the team. Still nothing.

I guess it is not a high priority.

4reactions
timsuchanekcommented, Jan 30, 2021

In case you want to save yourself all of this overhead, here a shameless plug: I built https://graphcdn.io, which takes care of the caching for you. I promise you, that you won’t hit these limitations there. You won’t need to host any Redis with that anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable Redis Caching at run time if redis connection ...
If the Redis connection is stale/closed or otherwise, then you want the application to bypass caching and (presumably) go directly to an underlying...
Read more >
Data sources - Apollo Server - Apollo GraphQL Docs
Data sources are classes that encapsulate fetching data from a particular service, with built-in support for caching, deduplication, and error handling.
Read more >
Spring Boot Redis Cache - DigitalOcean
In this post, we will setup up a sample Spring boot application and integrate it with Redis Cache. While Redis is an Open...
Read more >
Amazon ElastiCache for Redis
Amazon ElastiCache for Redis is a Redis-compatible in-memory data store service that can be used as a database, cache, message broker, and queue...
Read more >
Spring Data Redis
The Spring Framework is the leading full-stack Java/JEE application framework. It provides a lightweight container and a non-invasive ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found