Skip to content

Commit b860894

Browse files
authored
Hopeful timeout fixes (#39)
1 parent dae21de commit b860894

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

config/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ full_node:
6969
# This SSH key is for the ui SSH server
7070
ssh_filename: config/ssh_host_key
7171
# How often to connect to introducer if we need to learn more peers
72-
introducer_connect_interval: 120
72+
introducer_connect_interval: 500
7373
# Continue trying to connect to more peers until this number of connections
7474
target_peer_count: 10
7575
# Only connect to peers who we have heard about in the last recent_peer_threshold seconds

src/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Database(ABC):
2323
def __init__(self, db_name):
2424
loop = asyncio.get_event_loop()
2525
client = motor_asyncio.AsyncIOMotorClient(
26-
"mongodb://localhost:27017/", io_loop=loop
26+
"mongodb://127.0.0.1:27017/", io_loop=loop
2727
)
2828
log.info("Connecting to mongodb database")
2929
self.db = client.get_database(

src/full_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ async def unfinished_block(
924924
if expected_time > constants["PROPAGATION_DELAY_THRESHOLD"]:
925925
log.info(f"Block is slow, expected {expected_time} seconds, waiting")
926926
# If this block is slow, sleep to allow faster blocks to come out first
927-
await asyncio.sleep(3)
927+
await asyncio.sleep(5)
928928

929929
async with self.store.lock:
930930
leader: Tuple[uint32, uint64] = self.store.get_unfinished_block_leader()

src/ui/prompt_ui.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import asyncio
22
import logging
33
import collections
4+
import concurrent
45
import os
56
from typing import Callable, List, Optional, Tuple
67
from yaml import safe_load
@@ -518,6 +519,8 @@ async def update_data(self):
518519
for pk in self.pool_pks
519520
]
520521
await asyncio.sleep(5)
522+
except concurrent.futures._base.CancelledError as e:
523+
log.warn(f"Cancelled error in UI: {type(e)}: {e}")
521524
except Exception as e:
522525
log.warn(f"Exception in UI update_data {type(e)}: {e}")
523526
raise e

0 commit comments

Comments
 (0)