question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blocking calls not working as expected in the case of disconnections

See original GitHub issue

We are having a serious issue in bull (https://github.com/OptimalBits/bull/issues/890), where the queue stops processing commands in the event of disconnections. I have tracked it down to be an issue in ioredis. It seems that blocking commands are not handled properly in the case of disconnections. It is very easy to reproduce, but there are many cases to consider. Here I report the most obvious ones.

Code to reproduce:

const Redis = require('ioredis');

const redis = new Redis();

redis.brpoplpush('source', 'destination', 10).then(function(result){
  console.log(result)
}, function(err){
  console.error(err);
});

redis.on('error', function(err){
  // Outcommented to avoid noise.
  / /console.log('ERROR EVENT', err);
});

Case 1. Disconnect before calling blocking command.

Behaviour Dangling call, nothing happens for ever. Expected Error or at least timeout after given timeout.

Case 2. Connected before calling command, disconnected afterwards.

Behaviour Dangling call, nothing happens for ever. Expected Error or at least timeout after given timeout.

Case 3. Connected before calling blocking command, disconnected and then reconnected.

Behaviour Dangling call, nothing happens for ever. Expected Error or at least timeout after given timeout.

Case 4. Disconnected before calling blocking command, connected afterwards.

Behaviour Timeout after 10 seconds after reconnection.

Expected Works as expected?

Since the blocking command is not cancelable (https://github.com/luin/ioredis/issues/516), there is currently no workaround I know of for this, and you may end with a dangling client, so I think this issue is quite serious but please lets discuss it.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:10
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
manastcommented, Jul 17, 2018

@carly not yet. I need to provide better test code for @luin but I did not have enough time for it, I will try to prioritize it.

3reactions
manastcommented, May 4, 2018

ok, I try to test again with a reproducible environment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to block" No Caller ID " call from my… - Apple Discussions
go to settings; open "Do Not Disturb"; slide on "Manual"; tap on "Allow Calls From"; Select "All Contacts". All calls from numbers not...
Read more >
Understand and resolve SQL Server blocking problems
This article provides instruction on first understanding what blocking is in terms of SQL Server and furthermore how to investigate its ...
Read more >
Android Phone Won't Make Calls? 10 Ways to Fix
If you use Do Not Disturb on your Android and have configured it incorrectly, you may be unknowingly blocking incoming calls. Double-check ...
Read more >
What Does It Mean When an iPhone Says "Person Is Not ...
Calling a Blocked Phone ... The person you are trying to reach may have blocked your number, so you receive the “Person is...
Read more >
Why Does My Phone Keep Dropping Calls? 7 Causes - Dialpad
1. If your network connection has dipped, you should get a notification or some kind of alert in your phone app (if you're...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found