weyoss / redis-smq

A simple high-performance Redis message queue for Node.js.
MIT License
588 stars 64 forks source link

Cannot switch to the same current state #43

Closed smdesmet closed 3 years ago

smdesmet commented 3 years ago

Since upgrading to the latest version(2.0.11), I always get this error when I failover my redis server. Error: Can not switch to the same current state. at switchState (/opt/app-root/src/node_modules/redis-smq/src/power-state-manager.js:19:19) at Object.goingUp (/opt/app-root/src/node_modules/redis-smq/src/power-state-manager.js:62:13) at Object.start (/opt/app-root/src/node_modules/redis-smq/src/scheduler.js:219:31) at Producer. (/opt/app-root/src/node_modules/redis-smq/src/instance.js:46:36) at Producer.emit (events.js:314:20) at Producer. (/opt/app-root/src/node_modules/redis-smq/src/instance.js:43:18) at Producer.emit (events.js:314:20) at Producer.completeBootstrap (/opt/app-root/src/node_modules/redis-smq/src/instance.js:264:14) at Producer. (/opt/app-root/src/node_modules/redis-smq/src/instance.js:40:60) at Producer.emit (events.js:314:20) at /opt/app-root/src/node_modules/redis-smq/src/instance.js:195:23 at /opt/app-root/src/node_modules/neo-async/async.js:6883:13 at /opt/app-root/src/node_modules/redis-smq/src/instance.js:184:22 at tryCatcher (/opt/app-root/src/node_modules/standard-as-callback/built/utils.js:11:23) at /opt/app-root/src/node_modules/standard-as-callback/built/index.js:19:49 at processTicksAndRejections (internal/process/task_queues.js:93:5)

Looks like the GOING_UP in the power-state-manager is emitted while it is already UP. I am using ioredis with sentinel support, the failover takes ~10sec. I haven't seen this issue with version 2.0.0

weyoss commented 3 years ago

Thank you for reporting. I am currently investigating this issue. Further updates will be posted later.

weyoss commented 3 years ago

The bug causing this issue has been located and fixed. You should upgrade your RedisSMQ installation to the latest version.

weyoss commented 3 years ago

Closing as resolved.