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

BRPOPLPUSH Error: Too many Cluster redirections. #1396

Closed
insanehong opened this issue Jul 25, 2019 · 2 comments
Closed

BRPOPLPUSH Error: Too many Cluster redirections. #1396

insanehong opened this issue Jul 25, 2019 · 2 comments

Comments

@insanehong
Copy link

insanehong commented Jul 25, 2019

Description

When after a few minutes of starting the process, I have some error.

Error 1.

BRPOPLPUSH Error: Too many Cluster redirections. Last error: Error: Connection is closed.

Error2.

BRPOPLPUSH Error: Too many Cluster redirections. Last error: ReplyError: MOVED 3768

Minimal, Working Test code to reproduce the issue.

import Queue from 'bull';
import Redis from 'ioredis';

const client: Redis.Cluster = new Redis.Cluster([...environments.REDIS_HOST], {
  scaleReads: 'slave',
});

const subscriber: Redis.Cluster = new Redis.Cluster([...environments.REDIS_HOST], {
  scaleReads: 'slave',
});

let queueOptions: Queue.QueueOptions = _.extend({}, defaultOptions, options);

    queueOptions.createClient = (type: string): Redis.Cluster => {
      switch (type) {
        case 'client':
          return client;
        case 'subscriber':
          return subscriber;
        default:
          const defaultClient: Redis.Cluster = new Redis.Cluster([...environments.REDIS_HOST], 
      {
            scaleReads: 'slave',
          });
          return defaultClient;
      }
    };
const messageQueuesprocess = new Queue('testQueue', queueOptions);

public async process(options: WorkerOptions, worker: Queue.ProcessPromiseFunction<Function>): Promise<void> {
    try {
      await messageQueuesprocess(options.concurrency, worker);
    } catch (e) {
      throw new Error(e);
    }
  }

process()

Bull version

v3.10.0

Additional information

Redis info

  • Cluster: 3 master, 3slave
  • version: 5.1
@stansv
Copy link
Contributor

stansv commented Jul 25, 2019

Looks like we need to upgrade ioredis redis/ioredis#850.

@insanehong
Copy link
Author

@stansv Thanks for your help.

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

No branches or pull requests

2 participants