From 26c4bffa7950ed41c72abc34bce1a09de7ddd6ac Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 14 Jun 2017 14:47:05 -0700 Subject: [PATCH 1/7] Upgrade Protobuf.js 6 code to work with 6.8 --- src/protobuf_js_6_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protobuf_js_6_common.js b/src/protobuf_js_6_common.js index 91a458aa..e2451b4b 100644 --- a/src/protobuf_js_6_common.js +++ b/src/protobuf_js_6_common.js @@ -64,7 +64,7 @@ exports.deserializeCls = function deserializeCls(cls, options) { * @return {cls} The resulting object */ return function deserialize(arg_buf) { - return cls.decode(arg_buf).toObject(conversion_options); + return cls.toObject(cls.decode(arg_buf), conversion_options); }; }; From 6dc71db74ba374836dbcfc3d4847c4d3dc651990 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 15 Jun 2017 17:32:32 -0700 Subject: [PATCH 2/7] Fix missing return after callback in a function --- src/client.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client.js b/src/client.js index f59ac5c9..8892aa7c 100644 --- a/src/client.js +++ b/src/client.js @@ -152,6 +152,7 @@ function _write(chunk, encoding, callback) { /* Once a write fails, just call the callback immediately to let the caller flush any pending writes. */ setImmediate(callback); + return; } try { message = this.serialize(chunk); From eb5c93f2991f74d35174a42e89e05bdae210c295 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 19 Jun 2017 12:36:11 -0700 Subject: [PATCH 3/7] Add another missing return after a callback --- src/client.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client.js b/src/client.js index 8892aa7c..0b441449 100644 --- a/src/client.js +++ b/src/client.js @@ -165,6 +165,7 @@ function _write(chunk, encoding, callback) { this.call.cancelWithStatus(constants.status.INTERNAL, 'Serialization failure'); callback(e); + return; } if (_.isFinite(encoding)) { /* Attach the encoding if it is a finite number. This is the closest we From 59aab661f0a27f9a846ec2ddfc752603a425fadc Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 19 Jun 2017 13:19:49 -0700 Subject: [PATCH 4/7] Fix racy Node reconnect test --- test/surface_test.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/test/surface_test.js b/test/surface_test.js index 11577e79..71782ae6 100644 --- a/test/surface_test.js +++ b/test/surface_test.js @@ -1413,13 +1413,25 @@ describe('Client reconnect', function() { }); server.bind('localhost:' + port, server_insecure_creds); server.start(); - client.echo(undefined, function(error, response) { - if (error) { - console.log(error); - } + + /* We create a new client, that will not throw an error if the server + * is not immediately available. Instead, it will wait for the server + * to be available, then the call will complete. Once this happens, the + * original client should be able to make a new call and connect to the + * restarted server without having the call fail due to connection + * errors. */ + var client2 = new Client('localhost:' + port, + grpc.credentials.createInsecure()); + client2.echo({value: 'test', value2: 3}, function(error, response) { assert.ifError(error); - assert.deepEqual(response, {value: '', value2: 0}); - done(); + client.echo(undefined, function(error, response) { + if (error) { + console.log(error); + } + assert.ifError(error); + assert.deepEqual(response, {value: '', value2: 0}); + done(); + }); }); }); }); From c633e305e0a3563c7ab8cc0eb9ff987c228c0b45 Mon Sep 17 00:00:00 2001 From: Ken Payson Date: Mon, 19 Jun 2017 18:31:15 -0700 Subject: [PATCH 5/7] Bump to version 1.4.0 --- health_check/package.json | 4 ++-- tools/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/health_check/package.json b/health_check/package.json index 238547c1..f619e3f3 100644 --- a/health_check/package.json +++ b/health_check/package.json @@ -1,6 +1,6 @@ { "name": "grpc-health-check", - "version": "1.4.0-pre1", + "version": "1.4.0", "author": "Google Inc.", "description": "Health check service for use with gRPC", "repository": { @@ -15,7 +15,7 @@ } ], "dependencies": { - "grpc": "^1.4.0-pre1", + "grpc": "^1.4.0", "lodash": "^3.9.3", "google-protobuf": "^3.0.0" }, diff --git a/tools/package.json b/tools/package.json index f4f72a4d..777be92f 100644 --- a/tools/package.json +++ b/tools/package.json @@ -1,6 +1,6 @@ { "name": "grpc-tools", - "version": "1.4.0-pre1", + "version": "1.4.0", "author": "Google Inc.", "description": "Tools for developing with gRPC on Node.js", "homepage": "http://www.grpc.io/", From 173f7a39ae61a500f878a9a03e604c7387aca4b5 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 23 Jun 2017 15:10:18 -0700 Subject: [PATCH 6/7] Node: fix status memory leak, improve tcp_uv read buffer allocation code --- ext/call.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/call.cc b/ext/call.cc index 9453000a..7446c8d0 100644 --- a/ext/call.cc +++ b/ext/call.cc @@ -398,7 +398,10 @@ class ClientStatusOp : public Op { public: ClientStatusOp() { grpc_metadata_array_init(&metadata_array); } - ~ClientStatusOp() { grpc_metadata_array_destroy(&metadata_array); } + ~ClientStatusOp() { + grpc_metadata_array_destroy(&metadata_array); + grpc_slice_unref(status_details); + } bool ParseOp(Local value, grpc_op *out) { out->data.recv_status_on_client.trailing_metadata = &metadata_array; From ded4599100f6c0d7f31a52910ee1aed3874182aa Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 27 Jun 2017 10:40:48 -0700 Subject: [PATCH 7/7] Bump version to 1.4.1 --- health_check/package.json | 4 ++-- tools/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/health_check/package.json b/health_check/package.json index f619e3f3..3cdcb41c 100644 --- a/health_check/package.json +++ b/health_check/package.json @@ -1,6 +1,6 @@ { "name": "grpc-health-check", - "version": "1.4.0", + "version": "1.4.1", "author": "Google Inc.", "description": "Health check service for use with gRPC", "repository": { @@ -15,7 +15,7 @@ } ], "dependencies": { - "grpc": "^1.4.0", + "grpc": "^1.4.1", "lodash": "^3.9.3", "google-protobuf": "^3.0.0" }, diff --git a/tools/package.json b/tools/package.json index 777be92f..03cd90f9 100644 --- a/tools/package.json +++ b/tools/package.json @@ -1,6 +1,6 @@ { "name": "grpc-tools", - "version": "1.4.0", + "version": "1.4.1", "author": "Google Inc.", "description": "Tools for developing with gRPC on Node.js", "homepage": "http://www.grpc.io/",