From 9b71026d4b38234d9b4133ebf5cd904985f84503 Mon Sep 17 00:00:00 2001 From: Shahbaz Nazir Date: Thu, 26 Apr 2018 16:50:20 +0200 Subject: [PATCH] Problem: Arbitrary max_tries in bigchaindb when connecting to tendermint ws (#2241) * remove max_tries while connecting to tendermint ws Signed-off-by: Shahbaz Nazir * leave healthcheck as is for now Signed-off-by: Shahbaz Nazir --- bigchaindb/tendermint/event_stream.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bigchaindb/tendermint/event_stream.py b/bigchaindb/tendermint/event_stream.py index f681344a..4d9a59f2 100644 --- a/bigchaindb/tendermint/event_stream.py +++ b/bigchaindb/tendermint/event_stream.py @@ -67,22 +67,19 @@ def subscribe_events(ws, stream_id): @asyncio.coroutine -def try_connect_and_recv(event_queue, max_tries): +def try_connect_and_recv(event_queue): try: yield from connect_and_recv(event_queue) except Exception as e: - if max_tries: - logger.warning('WebSocket connection failed with exception %s', e) - time.sleep(3) - yield from try_connect_and_recv(event_queue, max_tries-1) - else: - logger.exception('WebSocket connection failed with exception %s', e) + logger.warning('WebSocket connection failed with exception %s', e) + time.sleep(3) + yield from try_connect_and_recv(event_queue) def start(event_queue): loop = asyncio.get_event_loop() try: - loop.run_until_complete(try_connect_and_recv(event_queue, 10)) + loop.run_until_complete(try_connect_and_recv(event_queue)) except (KeyboardInterrupt, SystemExit): logger.info('Shutting down Tendermint event stream connection')