From 0c8927dbbe80471f59241b556b24e31dc4396c3f Mon Sep 17 00:00:00 2001 From: vrde Date: Mon, 6 Feb 2017 16:21:22 +0100 Subject: [PATCH] Add comment to hackish solution --- bigchaindb/backend/mongodb/changefeed.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bigchaindb/backend/mongodb/changefeed.py b/bigchaindb/backend/mongodb/changefeed.py index 8bdaca92..4a5a5b7e 100644 --- a/bigchaindb/backend/mongodb/changefeed.py +++ b/bigchaindb/backend/mongodb/changefeed.py @@ -27,9 +27,11 @@ class MongoDBChangeFeed(ChangeFeed): while True: try: - # XXX: hack to force reconnection, - # the correct way to fix this is to manage errors - # for cursors.conn + # XXX: hack to force reconnection. Why? Because the cursor + # in `run_changefeed` does not run in the context of a + # Connection object, so if the connection is lost we need + # to manually reset the connection to None. + # See #1154 self.connection.connection = None self.run_changefeed() break