Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: redis/ioredis
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.19.1
Choose a base ref
...
head repository: redis/ioredis
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.19.2
Choose a head ref
  • 4 commits
  • 6 files changed
  • 3 contributors

Commits on Oct 31, 2020

  1. Copy the full SHA
    1bc8ca0 View commit details
  2. chore: Remove Node 6 from Travis.

    ShogunPanda authored and AVVS committed Oct 31, 2020
    Copy the full SHA
    dc3cac8 View commit details
  3. chore: remove node 15 from travis as it currently fails

    NOTE:  not connected with the code itself, just unable to launch node 15 at all
    AVVS committed Oct 31, 2020
    Copy the full SHA
    f4c0d89 View commit details
  4. chore(release): 4.19.2 [skip ci]

    ## [4.19.2](v4.19.1...v4.19.2) (2020-10-31)
    
    ### Bug Fixes
    
    * Fix autopipeline and downgrade p-map to support Node 6. [[#1216](#1216)] ([1bc8ca0](1bc8ca0))
    semantic-release-bot committed Oct 31, 2020
    Copy the full SHA
    9786122 View commit details
Showing with 88 additions and 22 deletions.
  1. +1 −2 .travis.yml
  2. +7 −0 Changelog.md
  3. +1 −1 lib/autoPipelining.ts
  4. +9 −9 package-lock.json
  5. +2 −2 package.json
  6. +68 −8 test/functional/cluster/autopipelining.ts
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -2,10 +2,9 @@ language: node_js

node_js:
- "8"
- "9"
- "10"
- "11"
- "12"
- "14"

services:
- redis-server
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [4.19.2](https://github.com/luin/ioredis/compare/v4.19.1...v4.19.2) (2020-10-31)


### Bug Fixes

* Fix autopipeline and downgrade p-map to support Node 6. [[#1216](https://github.com/luin/ioredis/issues/1216)] ([1bc8ca0](https://github.com/luin/ioredis/commit/1bc8ca0d05ab830a04502acd1cfc2796aca256ec))

## [4.19.1](https://github.com/luin/ioredis/compare/v4.19.0...v4.19.1) (2020-10-28)


2 changes: 1 addition & 1 deletion lib/autoPipelining.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ export const notAllowedAutoPipelineCommands = [
"unpsubscribe",
];

function findAutoPipeline(client, ...args: Array<string>): string {
function findAutoPipeline(client, _commandName, ...args: Array<string>): string {
if (!client.isCluster) {
return "main";
}
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ioredis",
"version": "4.19.1",
"version": "4.19.2",
"description": "A robust, performance-focused and full-featured Redis client for Node.js.",
"main": "built/index.js",
"files": [
@@ -38,7 +38,7 @@
"denque": "^1.1.0",
"lodash.defaults": "^4.2.0",
"lodash.flatten": "^4.4.0",
"p-map": "^4.0.0",
"p-map": "^2.1.0",
"redis-commands": "1.6.0",
"redis-errors": "^1.2.0",
"redis-parser": "^3.0.0",
76 changes: 68 additions & 8 deletions test/functional/cluster/autopipelining.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { expect, use } from "chai";
import * as calculateKeySlot from 'cluster-key-slot';

import { default as Cluster } from "../../../lib/cluster";
import MockServer from "../../helpers/mock_server";

@@ -395,14 +397,29 @@ describe("autoPipelining for cluster", function () {
await new Promise((resolve) => cluster.once("connect", resolve));

const promise1 = cluster.set("foo1", "bar");
const promise2 = cluster.set("foo2", "bar");
const promise2 = cluster.set("foo5", "bar");
const promise3 = cluster.set("foo2", "bar");
const promise4 = cluster.set("foo6", "bar");

// Override slots to induce a failure
const key1Slot = calculateKeySlot('foo1');
const key2Slot = calculateKeySlot('foo2');
const key5Slot = calculateKeySlot('foo5');
cluster.slots[key1Slot] = cluster.slots[key2Slot];
cluster.slots[key2Slot] = cluster.slots[key5Slot];

await expect(promise1).to.eventually.be.rejectedWith(
"All keys in the pipeline should belong to the same slots allocation group"
);
await expect(promise2).to.eventually.be.rejectedWith(
"All keys in the pipeline should belong to the same slots allocation group"
);
await expect(promise3).to.eventually.be.rejectedWith(
"All keys in the pipeline should belong to the same slots allocation group"
);
await expect(promise4).to.eventually.be.rejectedWith(
"All keys in the pipeline should belong to the same slots allocation group"
);

cluster.disconnect();
});
@@ -411,7 +428,7 @@ describe("autoPipelining for cluster", function () {
const cluster = new Cluster(hosts, { enableAutoPipelining: true });

cluster.once("connect", () => {
let err1, err2;
let err1, err2, err3, err4;

function cb() {
expect(err1.message).to.eql(
@@ -420,6 +437,12 @@ describe("autoPipelining for cluster", function () {
expect(err2.message).to.eql(
"All keys in the pipeline should belong to the same slots allocation group"
);
expect(err3.message).to.eql(
"All keys in the pipeline should belong to the same slots allocation group"
);
expect(err4.message).to.eql(
"All keys in the pipeline should belong to the same slots allocation group"
);
expect(cluster.autoPipelineQueueSize).to.eql(0);

cluster.disconnect();
@@ -431,22 +454,49 @@ describe("autoPipelining for cluster", function () {
cluster.set("foo1", "bar1", (err) => {
err1 = err;

if (err1 && err2) {
if (err1 && err2 && err3 && err4) {
cb();
}
});

expect(cluster.autoPipelineQueueSize).to.eql(1);

cluster.set("foo2", (err) => {
cluster.set("foo2", "bar2", (err) => {
err2 = err;

if (err1 && err2) {
if (err1 && err2 && err3 && err4) {
cb();
}
});

expect(cluster.autoPipelineQueueSize).to.eql(2);

cluster.set("foo5", "bar5", (err) => {
err3 = err;

if (err1 && err2 && err3 && err4) {
cb();
}
});

expect(cluster.autoPipelineQueueSize).to.eql(3);

cluster.set("foo6", "bar6", (err) => {
err4 = err;

if (err1 && err2 && err3 && err4) {
cb();
}
});

expect(cluster.autoPipelineQueueSize).to.eql(4);

// Override slots to induce a failure
const key1Slot = calculateKeySlot('foo1');
const key2Slot = calculateKeySlot('foo2');
const key5Slot = calculateKeySlot('foo5');
cluster.slots[key1Slot] = cluster.slots[key2Slot];
cluster.slots[key2Slot] = cluster.slots[key5Slot];
});
});

@@ -457,13 +507,16 @@ describe("autoPipelining for cluster", function () {
process.removeAllListeners("uncaughtException");

cluster.once("connect", () => {
let err1;
let err1, err5;

process.once("uncaughtException", (err) => {
expect(err.message).to.eql("ERROR");
expect(err1.message).to.eql(
"All keys in the pipeline should belong to the same slots allocation group"
);
expect(err5.message).to.eql(
"All keys in the pipeline should belong to the same slots allocation group"
);

for (const listener of listeners) {
process.on("uncaughtException", listener);
@@ -476,14 +529,21 @@ describe("autoPipelining for cluster", function () {
cluster.set("foo1", "bar1", (err) => {
err1 = err;
});
cluster.set("foo5", "bar5", (err) => {
err5 = err;
});

expect(cluster.autoPipelineQueueSize).to.eql(1);
expect(cluster.autoPipelineQueueSize).to.eql(2);

cluster.set("foo2", (err) => {
throw new Error("ERROR");
});

expect(cluster.autoPipelineQueueSize).to.eql(2);
expect(cluster.autoPipelineQueueSize).to.eql(3);

const key1Slot = calculateKeySlot('foo1');
const key2Slot = calculateKeySlot('foo2');
cluster.slots[key1Slot] = cluster.slots[key2Slot];
});
});
});