Github user nsuke commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1141#discussion_r93366270
  
    --- 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 --
    
    Reading the doc, simply putting 'timeout' key value to `nodeOptions` 
(without any code change) would activate request timeout.
    `socket.setTimeout` is for idle connections which is very different thing.
    So reusing the former value to the latter does not seem a good idea.
    Do you need idle timeout for your use-case at all ?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to