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

    https://github.com/apache/thrift/pull/1141#discussion_r93412832
  
    --- 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 --
    
    Yes it turned out basically the same thing.
    The potential problem was that, as long as we're using the name "timeout", 
Node will put their own timeout handler on newer versions.
    It's especially nasty because a future version of Node can change it's 
internal behavior as to how exactly the timeout is handled, and it can cause 
subtle conflict with our own handling later.
    
    But thinking about it, if it's what people have been widely doing, it's 
unlikely Node will start doing things that conflict with it.


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