diff --git a/src/node/src/client.js b/src/node/src/client.js
index aa818349daa409fd7863004b64264ea55df962c7..2073d3eea8db11ee7d90b0f32b479f2b7a1b2143 100644
--- a/src/node/src/client.js
+++ b/src/node/src/client.js
@@ -104,7 +104,7 @@ function _write(chunk, encoding, callback) {
   if (this.writeFailed) {
     /* Once a write fails, just call the callback immediately to let the caller
        flush any pending writes. */
-    callback();
+    setImmediate(callback);
   }
   try {
     message = this.serialize(chunk);