thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guptanishank <...@git.apache.org>
Subject [GitHub] thrift pull request #1141: support for timeout in node http connection
Date Wed, 21 Dec 2016 11:16:28 GMT
Github user guptanishank commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1141#discussion_r93419768
  
    --- Diff: lib/nodejs/lib/thrift/http_connection.js ---
    @@ -214,6 +214,18 @@ HttpConnection.prototype.write = function(data) {
       var req = (self.https) ?
           https.request(self.nodeOptions, self.responseCallback) :
           http.request(self.nodeOptions, self.responseCallback);
    +
    +  //support for timeout
    +  var timeout = self.nodeOptions.timeout;
    +  if(timeout){
    +    req.on('socket', function (socket) {
    +        socket.setTimeout(timeout);  
    +        socket.on('timeout', function() {
    +            req.abort();
    +        });
    +    });
    +  }
    --- End diff --
    
    @nsuke  One workaround could be to use a different option like "socketTimeout" and mention
in documentation that this option is for node versions not having support for timeout.
    
    Also, could you look patch submitted in this JIRA ticket: THRIFT-2968


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message