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

when I restart the redis master the jobs stop #1390

Closed
juanpabloaj opened this issue Jul 18, 2019 · 4 comments
Closed

when I restart the redis master the jobs stop #1390

juanpabloaj opened this issue Jul 18, 2019 · 4 comments

Comments

@juanpabloaj
Copy link

juanpabloaj commented Jul 18, 2019

Description

I have a bull code example and a redis with replication when I restart the redis master the jobs stop and I get this message

...
processing video 59969
processing video 59970
processing video 59971
processing video 59972
processing video repeat:6f7759385e855ae9ce8f89c1765be3a3:1563459010000
processing video 59976
processing video repeat:6f7759385e855ae9ce8f89c1765be3a3:1563459011000
processing video 59978
Error in bull queue happend: Error: read ECONNRESET
Error in bull queue happend: Error: read ECONNRESET
Error in bull queue happend: Error: read ECONNRESET
Error in bull queue happend: Error: read ECONNRESET
Error in bull queue happend: Error: connect ECONNREFUSED 127.0.0.1:6379
Error in bull queue happend: Error: connect ECONNREFUSED 127.0.0.1:6379
Error in bull queue happend: Error: connect ECONNREFUSED 127.0.0.1:6379
Error in bull queue happend: Error: connect ECONNREFUSED 127.0.0.1:6379
Error in bull queue happend: Error: connect ECONNREFUSED 127.0.0.1:6379
Error in bull queue happend: Error: connect ECONNREFUSED 127.0.0.1:6379
Error in bull queue happend: Error: connect ECONNREFUSED 127.0.0.1:6379
Error in bull queue happend: Error: connect ECONNREFUSED 127.0.0.1:6379
Error in bull queue happend: Error: connect ECONNREFUSED 127.0.0.1:6379
Error in bull queue happend: Error: read ECONNRESET
Error in bull queue happend: Error: read ECONNRESET
Error in bull queue happend: ReplyError: ERR only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context

Minimal, Working Test code to reproduce the issue.

(An easy to reproduce test case will dramatically decrease the resolution time.)

bull code, index.js

var Queue = require('bull');

var videoQueue = new Queue('video encoding', 'redis://127.0.0.1:6379');

videoQueue
  .on('error', function (error) {
    console.error(`Error in bull queue happend: ${error}`);
  })
  .on('failed', function (job, error) {
    console.error(`Task was failed with reason: ${error}`);
  });

videoQueue.process(function(job, done) {

  console.log("processing video " + job.id);

  done();
});

videoQueue.add(
  {foo: 'bar'},
  {
    repeat: {
      every: 1000,
      limit: 1000
    }
  }
);

setInterval(function () {
  videoQueue.add({name:'test_task'}, {});
}, 1000);

docker-compose redis with replication
https://gist.github.com/Nikkely/ffa66e6a5a6b9019a2318bdf97d66d33

version: '3'

services:
  redis:
    image: redis:5.0.0
    container_name: master
    ports:
      - "6379:6379"
    networks:
      - redis-replication

  redis-slave:
    image: redis:5.0.0
    container_name: slave
    ports:
      - "6380:6379"
    command: redis-server --slaveof master 6379
    depends_on:
      - redis
    networks:
      - redis-replication

networks:
  redis-replication:

start redis

docker-compose up -d

start code (in other terminal)

node index.js

restart redis master

docker-compose restart redis

Bull version

bull@3.10.0

@manast
Copy link
Member

manast commented Aug 1, 2019

isn't it just because since the master is down the worker simply cannot connect to redis?

@zyf0330
Copy link

zyf0330 commented Jan 15, 2020

#890 give a suggestion, redis option enableReadyCheck: false will let Bull resume from redis server restart.
But in this situation, repeatable job data is lost in redis and Bull won't recreate it automatically.

@stale
Copy link

stale bot commented Jul 12, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 12, 2021
@stale stale bot removed the wontfix label Jul 13, 2021
@stale
Copy link

stale bot commented Sep 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 11, 2021
@stale stale bot closed this as completed Sep 18, 2021
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

3 participants