[ 
https://issues.apache.org/jira/browse/THRIFT-3328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15044548#comment-15044548
 ] 

ASF GitHub Bot commented on THRIFT-3328:
----------------------------------------

GitHub user HIRANO-Satoshi opened a pull request:

    https://github.com/apache/thrift/pull/734

    THRIFT-3328 A callback is not called when a server is down.

    https://issues.apache.org/jira/browse/THRIFT-3328

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/HIRANO-Satoshi/thrift patch-1

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/734.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #734
    
----
commit 99a239a3cd4ea2325434859210694b1983949f35
Author: HIRANO Satoshi <[email protected]>
Date:   2015-12-07T08:17:15Z

    THRIFT-3328 A callback is not called when a server is down.
    
    https://issues.apache.org/jira/browse/THRIFT-3328

----


> A callback is not called when a server is down.
> -----------------------------------------------
>
>                 Key: THRIFT-3328
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3328
>             Project: Thrift
>          Issue Type: Bug
>          Components: JavaScript - Library
>            Reporter: HIRANO Satoshi
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When an async method is called in a JS client for a server which is down, the 
> call should call a supplied callback. 
> Actually the async call fails with the following error and the callback not 
> called.
> OPTIONS http://xxxx net::ERR_CONNECTION_REFUSED
> Note that the above OPTIONS is because I use HTTP OPTIONS. Don't mind.
> Thrift.TXHRTransport.flush() has the following fragment.
>         if (callback) {
>             //Ignore XHR callbacks until the data arrives, then call the
>             //  client's callback
>             xreq.onreadystatechange = 
>               (function() {
>                 var clientCallback = callback;    
>                 return function() {
>                   if (this.readyState == 4 && this.status == 200) {
>                     self.setRecvBuffer(this.responseText);
>                     clientCallback();
>                   }
>                 };
>               }());
>         }
> I think the reason why the callback is not called is that "this.status == 
> 200" ignores fatal statuses and skips clientCallback().



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to