diff --git a/src/node/src/client.js b/src/node/src/client.js index 9a50bf24d9c95d61dfd70fbe1143d1c688ee1f74..65339406b2cc0caf27d6c0bbcc9be2bf0009e3f5 100644 --- a/src/node/src/client.js +++ b/src/node/src/client.js @@ -80,7 +80,11 @@ function _write(chunk, encoding, callback) { var batch = {}; batch[grpc.opType.SEND_MESSAGE] = this.serialize(chunk); this.call.startBatch(batch, function(err, event) { - callback(err); + if (err) { + // Something has gone wrong. Stop writing by failing to call callback + return; + } + callback(); }); }