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
    • Resolution: Fixed
    • Major
    • 2.3.4
    • 2.3.3
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            matt.carabine Matt Carabine (Inactive)
            matt.carabine Matt Carabine (Inactive)
            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