You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ra...@apache.org on 2016/05/06 02:04:53 UTC

thrift git commit: THRIFT-3789: Add destroy connection feature to node Client: Nodejs Patch: James Reggio

Repository: thrift
Updated Branches:
  refs/heads/master 7fadf5720 -> 9b954e6a4


THRIFT-3789: Add destroy connection feature to node
Client: Nodejs
Patch: James Reggio

Github Pull Request:
This closes #989
commit b2907fd207736ec95f37919528f6dc6990f007c8
Author: James Reggio <ja...@gmail.com>
Date: 2016-04-18T19:49:50Z
THRIFT-3789 Add `destroy` to Connection instance
This commit proxies the `destroy` method from the Thrift Connection
object to its underlying socket, akin to the existing `end` method.
Without `destroy`, it's possible for a failed TLS socket to hold the
Node.js process open. (Calling `end` is not sufficient to close the OS
handle because `end` sends a FIN packet, which is never acknowledged by
the server.)


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/9b954e6a
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/9b954e6a
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/9b954e6a

Branch: refs/heads/master
Commit: 9b954e6a469fef18682314458e6fc4af2dd84add
Parents: 7fadf57
Author: Randy Abernethy <ra...@apache.org>
Authored: Thu May 5 19:01:04 2016 -0700
Committer: Randy Abernethy <ra...@apache.org>
Committed: Thu May 5 19:01:04 2016 -0700

----------------------------------------------------------------------
 lib/nodejs/lib/thrift/connection.js | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/9b954e6a/lib/nodejs/lib/thrift/connection.js
----------------------------------------------------------------------
diff --git a/lib/nodejs/lib/thrift/connection.js b/lib/nodejs/lib/thrift/connection.js
index f9c9bcc..0ea50d3 100644
--- a/lib/nodejs/lib/thrift/connection.js
+++ b/lib/nodejs/lib/thrift/connection.js
@@ -163,6 +163,10 @@ Connection.prototype.end = function() {
   this.connection.end();
 };
 
+Connection.prototype.destroy = function() {
+  this.connection.destroy();
+};
+
 Connection.prototype.initialize_retry_vars = function () {
   this.retry_timer = null;
   this.retry_totaltime = 0;