Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-463

TXIoEvent errors out application upon connection loss

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.3
    • 2.3.4
    • library
    • None

    Description

      When a connection is lost, tornado will callback to the twisted object to tell it about the failure.

      The problem is it differentiates read failures and write failures using the readConnectionLost and writeConnectionLost methods.

      Our TxIOEvent class actually only has a generic connectionLost method.
      To make the API compatible without breaking anything or changing behaviour for anything else, we should add readConnectionLost and writeConnectionLost methods which in turn just call the existing connectionLost method.

      Example of the error which will crash the coroutine:

      2018-01-12T07:20:11.445581000Z ERROR|tornado.application: Exception in callback None
      2018-01-12T07:20:11.446154000Z Traceback (most recent call last):
      2018-01-12T07:20:11.446654000Z   File "/usr/local/lib/pypy2.7/dist-packages/tornado/ioloop.py", line 888, in start
      2018-01-12T07:20:11.447054000Z     handler_func(fd_obj, events)
      2018-01-12T07:20:11.447484000Z   File "/usr/local/lib/pypy2.7/dist-packages/tornado/stack_context.py", line 277, in null_wrapper
      2018-01-12T07:20:11.448008000Z     return fn(*args, **kwargs)
      2018-01-12T07:20:11.448443000Z   File "/usr/local/lib/pypy2.7/dist-packages/tornado/platform/twisted.py", line 196, in _invoke_callback
      2018-01-12T07:20:11.448846000Z     reader.readConnectionLost(failure.Failure(err))
      2018-01-12T07:20:11.449260000Z AttributeError: 'TxIOEvent' object has no attribute 'readConnectionLost'
      

      Attachments

        For Gerrit Dashboard: PYCBC-463
        # Subject Branch Project Status CR V

        Activity

          matt.carabine Matt Carabine created issue -
          matt.carabine Matt Carabine made changes -
          Field Original Value New Value
          Description When a connection is lost, tornado will callback to the twisted object to tell it about the failure.

          The problem is it differentiates read failures and write failures using the {{readConnectionLost}} and {{writeConnectionLost}} methods.

          Our TxIOEvent class actually only has a generic {{connectionLost}} method.
          To make the API compatible without breaking anything or changing behaviour for anything else, we should add {{readConnectionLost}} and {{writeConnectionLost}} methods which in turn just call the existing {{connectionLost}} method.
          When a connection is lost, tornado will callback to the twisted object to tell it about the failure.

          The problem is it differentiates read failures and write failures using the {{readConnectionLost}} and {{writeConnectionLost}} methods.

          Our TxIOEvent class actually only has a generic {{connectionLost}} method.
          To make the API compatible without breaking anything or changing behaviour for anything else, we should add {{readConnectionLost}} and {{writeConnectionLost}} methods which in turn just call the existing {{connectionLost}} method.

          Example of the error which will crash the coroutine:

          {noformat}
          2018-01-12T07:20:11.445581000Z ERROR|tornado.application: Exception in callback None
          2018-01-12T07:20:11.446154000Z Traceback (most recent call last):
          2018-01-12T07:20:11.446654000Z File "/usr/local/lib/pypy2.7/dist-packages/tornado/ioloop.py", line 888, in start
          2018-01-12T07:20:11.447054000Z handler_func(fd_obj, events)
          2018-01-12T07:20:11.447484000Z File "/usr/local/lib/pypy2.7/dist-packages/tornado/stack_context.py", line 277, in null_wrapper
          2018-01-12T07:20:11.448008000Z return fn(*args, **kwargs)
          2018-01-12T07:20:11.448443000Z File "/usr/local/lib/pypy2.7/dist-packages/tornado/platform/twisted.py", line 196, in _invoke_callback
          2018-01-12T07:20:11.448846000Z reader.readConnectionLost(failure.Failure(err))
          2018-01-12T07:20:11.449260000Z AttributeError: 'TxIOEvent' object has no attribute 'readConnectionLost'
          {noformat}
          Ellis.Breen Ellis Breen made changes -
          Status New [ 10003 ] Open [ 1 ]
          Ellis.Breen Ellis Breen made changes -
          Fix Version/s 2.3.4 [ 15051 ]
          matt.carabine Matt Carabine made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]

          People

            matt.carabine Matt Carabine
            matt.carabine Matt Carabine
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty