Skip to content

Commit 03a0558

Browse files
committed
Send less initial pings for healthcheck
Previously we would end up sending too many pings to a node to find out if it's healthy and in the meantime consider it as reachable. We would send 120 pings, waiting 60 seconds between each ping for the initial healthcheck. In the meantime, raiden would consider the node healthy and try to route transfers through it. Now for that special initial healthcheck we make sure to use a lot less pings and immediately consider it unhealthy if this does not work.
1 parent 7338462 commit 03a0558

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

raiden/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
DEFAULT_INITIAL_CHANNEL_TARGET = 3
2323
DEFAULT_WAIT_FOR_SETTLE = True
2424

25-
DEFAULT_NAT_KEEPALIVE_RETRIES = 5
26-
DEFAULT_NAT_KEEPALIVE_TIMEOUT = 30
25+
DEFAULT_NAT_KEEPALIVE_RETRIES = 2
26+
DEFAULT_NAT_KEEPALIVE_TIMEOUT = 10
2727
DEFAULT_NAT_INVITATION_TIMEOUT = 180

raiden/ui/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def convert(self, value, param, ctx):
161161
'Max time in seconds for which an address can send no packets and '
162162
'still be considered healthy.'
163163
),
164-
default=120,
164+
default=30,
165165
type=int,
166166
),
167167
click.option(
@@ -284,9 +284,9 @@ def app(address,
284284
config['external_ip'] = listen_host
285285
config['external_port'] = listen_port
286286

287-
retries = max_unresponsive_time / DEFAULT_NAT_KEEPALIVE_RETRIES
288-
config['protocol']['nat_keepalive_retries'] = retries
289-
config['protocol']['nat_keepalive_timeout'] = send_ping_time
287+
config['protocol']['nat_keepalive_retries'] = DEFAULT_NAT_KEEPALIVE_RETRIES
288+
timeout = max_unresponsive_time / DEFAULT_NAT_KEEPALIVE_RETRIES
289+
config['protocol']['nat_keepalive_timeout'] = timeout
290290

291291
address_hex = address_encoder(address) if address else None
292292
address_hex, privatekey_bin = prompt_account(address_hex, keystore_path, password_file)

0 commit comments

Comments
 (0)