Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3328

A callback is not called when a server is down.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • JavaScript - Library
    • None

    Description

      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().

      Attachments

        Activity

          People

            hirano-s@aist.go.jp HIRANO Satoshi
            hirano-s@aist.go.jp HIRANO Satoshi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified