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

    https://github.com/apache/thrift/pull/1141#discussion_r93437696
  
    --- 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 --
    
    I cannot see the content of the patch as it has been removed.
    It's visible to everyone while it's available.
    
    I slightly prefer the different-name idea.
    As to the actual name, I would choose "requestTimeout" especially if we're 
going to invoke `request.setTimeout`.
    Seeing the 
[code](https://github.com/nodejs/node/blob/master/lib/_http_client.js#L501), 
the timeout callback is only active during each request life-cycle, and removed 
after completion so that it does not affect HTTP keep-alive behavior.
    In other words, direct `socket.setTimeout` would break socket reuse.


---
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