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
Reconnection problem #890
Comments
I have not tested further, but the signature to your process function is wrong, you can only have one argument, queue.process('test_task', function (job) {
console.log('start task');
return Promise.delay(5000).then(() => {
console.log('resolve task!');
});
}); |
actually, after fixing the signature I could test that the queue works well even with redis connection interruptions. please verify and close if it works for you. |
@manast Ok. Throw out my small wrappers and use only vanilla library. The result is the same. Added log outputs and cleaned code snippet. (see topic starter message) |
please try version 3.3.10 |
@manast the same story. =( Fixed version in description. |
@manast Is it reproducible on your machine? |
yes I did, seems like a bug in ioredis: seems like it handles incorrectly blocking commands in the event of a disconnection. I did not have time to report it as an issue and/or find a workaround. |
I did some tests where using this redis option did help: |
@manast It didn't help me. Absolutely the same result of the test. |
@manast Could you add a link to the ioredis issue? It's important for me to track it. May be if I have some time, I'll try to help them or will investigate the problem. |
Is there any new info about this. The ticket raised with the ioredis maintainer has not been updated. Are there any known workarounds for this issue? |
@lincoln-spiteri I tried the workaround suggested in ioredis#610 - disabling the built-in Also hoping for a better solution soon. |
Sorry for the late response. I tested locally using the code provided by @ks-s-a but the result looks correct for me:
I restarted the redis server multiple times at different stages (non-task processing time & processing time) but the result stayed the same. Did I miss something? Tested with bull 3.3.10 & 3.4.1. |
|
Hi, We had a problem of re-connection on our queues, whenever the redis was stopped the "listening" queues could not restart and there was this message each time:
We solved it. Problem is that when reconnecting ioredis will check if server is ready. This check (https://github.com/luin/ioredis/blob/6dd3730617ece16f874e3ce3e5da0e113ac272d3/lib/redis.js#L413) use the So we just had to disable the
All the queues are now reconnecting has they should do and processing remaining jobs. 👍 We hope this option solves some of the connection problems in this thread (maybe not ...), @ks-s-a you might test this ;-) |
@luin tested same code provided by @ks-s-a , still have problem with reconnecting, same output as @ks-s-a provided. Any updates for this issue?
no more information even waiting a long time. |
@adogor Does not work for me. (3.10.0). Are there any updates on this? |
@psychonetic if you have a specific use-case where your problem is reproduced I recommend you to post that, because most issues in this thread are obsolete or user-code specific. |
Hi, I'm having issues in two specific situations:
I have forked a very simple tutorial from Heroku and updated its dependencies. It is a very simple project that creates a dashboard and creates jobs with the use of Express.js and Bull that can be used to replicate both issues mentioned above. I run Redis on a Docker container and I shut down the container and then start it again to simulate Redis availability. I also tried adding the |
@gigantedocil I have tested this recently and I could not reproduce any connection issues. Could you just provide some code snippet (not a full repo), that isolates the issue so that I can test it? |
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. |
Looks like this @adogor's approach is the default one for bullmq. @manast is there a reason this shouldn't be backported to bull? |
@killthekitten backport what exactly? |
@manast I mean setting the default configuration of the ioredis instance to Sorry for not making it clear. |
Check this and let me know if it clarifies this issue: https://docs.bullmq.io/bull/patterns/persistent-connections |
My mistake, I wasn't aware of the changes in this release and the ones above, and assumed it was only implemented for bullmq. Thanks for pointing at the doc and sorry for dragging you here! |
Ok. I will close this issue then. |
Hi, I'm observing similar issue, details added here : #2612 In my case, I'm adding jobs in queue directly using Kindly let me know if I'm missing anything, or how to fix this ? It's really important. Thanks. |
Description
I create a queue and add tasks to queue every 10 seconds. Use bluebird library to set a delay in a task processor.
The point is - I'm trying to check behavior when redis connection is lost. When I switch off the redis server in prcessors work phase, everything is ok, we finish the task, reconnect and continue task processing.
If I try to switch off the redis server, when there is no tasks in queue, task processing is stop and it doesn't reconnect to the server. The connection is in "end" status.
I need to get any way to establish a connection after redis server was restarted. It's vital for our project.
Logs when I restart redis server on waiting period of the time (non-task processing time):
Logs when I restart redis server while a task is executing (processing time):
Look at the end of the copy-paste - new tasks are processing. Everything looks fine unlike the previous example.
Test code to reproduce
Bull version
bull - 3.3.10, node - v6.10.2
The text was updated successfully, but these errors were encountered: