Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Exception in pusher on_new_receipts: Cursor needed to be reset #6403

Closed
richvdh opened this issue Nov 22, 2019 · 0 comments
Closed

Exception in pusher on_new_receipts: Cursor needed to be reset #6403

richvdh opened this issue Nov 22, 2019 · 0 comments

Comments

@richvdh
Copy link
Member

richvdh commented Nov 22, 2019

occasionally /_matrix/client/r0/rooms/{roomId}/read_markers spits out this exception:

2019-11-22 13:44:21,146 - synapse.push.pusherpool - 204 - ERROR - POST-162567 - Exception in pusher on_new_receipts
Traceback (most recent call last):
  File "/home/path/to/server/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: <generator object ReceiptsWorkerStore.get_all_updated_receipts.<locals>.get_all_updated_receipts_txn.<locals>.<genexpr> at 0x7faca013cca8>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/path/to/server/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: <generator object ReceiptsWorkerStore.get_all_updated_receipts.<locals>.get_all_updated_receipts_txn.<locals>.<genexpr> at 0x7faca013cca8>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/path/to/server/lib/python3.6/site-packages/synapse/push/pusherpool.py", line 196, in on_new_receipts
    users_affected = set([r[3] for r in updated_receipts])
  File "/home/path/to/server/lib/python3.6/site-packages/synapse/push/pusherpool.py", line 196, in <listcomp>
    users_affected = set([r[3] for r in updated_receipts])
  File "/home/path/to/server/lib/python3.6/site-packages/synapse/storage/data_stores/main/receipts.py", line 283, in <genexpr>
    return (r[0:5] + (json.loads(r[5]),) for r in txn)
sqlite3.InterfaceError: Cursor needed to be reset because of commit/rollback and can no longer be fetched from.

The symptoms are presumably that people get pushes for messages they have already read.

I think it's because get_all_updated_receipts returns a generator expression which refers to a database cursor, which refers to a database connection, which might get re-used before the results are read.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant