Skip to content

Unavailable Redis connection kills Nodejs process (crashes the server) #38

@danBamikiya

Description

@danBamikiya

Currently if the Redis server isn't available, the redis client throws an error and since this error is unhandled, it crashes the Nodejs server.

This is by design (a good thing) since the Redis store is used as the primary storage for shortened urls. So if the Redis server isn't available, the app can't work.
But when introducing a database, we'll want to avoid those crashes (handle the errors) since the database will now be the primary storage and the Redis store will be just a caching layer.

The current error logger has Sentry an application monitoring and error tracking software integrated into it so the error handler can log the errors as level error which is an high enough level to notify me.
Meanwhile a retry strategy could be implemented to retry establishing connections with the Redis server.

Also on redis client connection to the Redis server, the Redis server should be pinged periodically to prevent an idle connection timeout from closing the connection. The connection timeout is by default 1 hour.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestproductChanges to the product

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions