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

Handle Redis pubsub subscription failures. #1114

Open
PhanindraNeralla opened this issue Sep 24, 2024 · 1 comment
Open

Handle Redis pubsub subscription failures. #1114

PhanindraNeralla opened this issue Sep 24, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@PhanindraNeralla
Copy link

PhanindraNeralla commented Sep 24, 2024

We use fastify and mercurius.
We also use graphql subscriptions using redis pubsub (graphql-redis-subscriptions and io-redis) and setting up the schema of Resolvers ( Queries, Mutations, Subscriptions) while registering mercurius plugin onto fastify server.

Now, once app is up and running and later if Redis is down due to any reason, subscriptions are erroring out and causing app to crash. ( Handled using redisClient.on('error') , process.on('unhandledExceptions') etc , but still it doesnt help ).
Any idea how fastify/mercurius handles such cases? - like, we should be able to safely disable subscriptions OR return empty object for subscriptions while redis is down

My observations include, setting up error handlers only while setting up Fastify server. Not after that.
i.e. Once server is running and we have Redis down, how can we make sure our Fastify server handle subscriptions gracefully.

@mcollina
Copy link
Collaborator

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@mcollina mcollina added the enhancement New feature or request label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants