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

Managed redis connection keeps throwing error #102

Open
vizsatiz opened this issue Jul 18, 2023 · 3 comments
Open

Managed redis connection keeps throwing error #102

vizsatiz opened this issue Jul 18, 2023 · 3 comments

Comments

@vizsatiz
Copy link

I am using a managed redis instance with Digitial ocean. When I used redis-smq with node redis, the connection often crashes the server.

I dont seem to have a good way to catch this exception too

/app/node_modules/redis-smq/dist/src/lib/base.js:99
            throw err;
            ^
AbortError: Redis connection lost and command aborted. It might have been processed.
    at RedisClient.flush_and_error (/app/node_modules/redis-smq-common/node_modules/redis/index.js:298:23)
    at RedisClient.connection_gone (/app/node_modules/redis-smq-common/node_modules/redis/index.js:603:14)
    at TLSSocket.<anonymous> (/app/node_modules/redis-smq-common/node_modules/redis/index.js:231:14)
    at Object.onceWrapper (node:events:513:28)
    at TLSSocket.emit (node:events:406:35)
    at endReadableNT (node:internal/streams/readable:1343:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'UNCERTAIN_STATE',
  command: 'BRPOPLPUSH',
  args: [
    'redis-smq-v7.1:alpha:1:q_artoo_main_v1',
    'redis-smq-v7.1:alpha:5:q_artoo_main_v1:a365cb01-5362-4223-8ab3-a7f6b8d76f39',
    0
  ]
}
@weyoss
Copy link
Owner

weyoss commented Aug 4, 2023

@vizsatiz Thank you for reporting this issue.

The error message says "Redis connection lost and command aborted. It might have been processed". I believed that this issue is not related to RedisSMQ itself but to the environment from which the message queue is running.

If you still think that this error comes from the MQ please provide the steps required to reproduced it.

@vizsatiz
Copy link
Author

vizsatiz commented Aug 4, 2023

Hey @weyoss, I understand that Redis connection error has more to do with the Redis server, than redis-smq, but since the error is happening inside the redis-smq-common lib, and I do not have any handle to access the connection object, I do not have a graceful way to handle this scenario, and stop my app from crashing

Since the redis-smq interface doesn't let me handle the connection myself and just pass the connection object in, it becomes difficult to fix the connection or take necessary steps when the connection is lost.

So my suggestion would be to create a mechanism to gracefully handle such connection issues

@weyoss
Copy link
Owner

weyoss commented Mar 26, 2024

Starting with redis-smq@8.0.0-rc.20 errors handling for async callbacks has been reworked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants