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 |
87849,2 | PYCBC-463: Make TxIOEvent API compatible with Tornado | master | couchbase-python-client | Status: MERGED | +2 | +1 |