Skip to content

Commit

Permalink
Send less initial pings for healthcheck
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LefterisJP committed Sep 12, 2017
1 parent 7338462 commit 03a0558
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions raiden/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
DEFAULT_INITIAL_CHANNEL_TARGET = 3
DEFAULT_WAIT_FOR_SETTLE = True

DEFAULT_NAT_KEEPALIVE_RETRIES = 5
DEFAULT_NAT_KEEPALIVE_TIMEOUT = 30
DEFAULT_NAT_KEEPALIVE_RETRIES = 2
DEFAULT_NAT_KEEPALIVE_TIMEOUT = 10
DEFAULT_NAT_INVITATION_TIMEOUT = 180
8 changes: 4 additions & 4 deletions raiden/ui/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def convert(self, value, param, ctx):
'Max time in seconds for which an address can send no packets and '
'still be considered healthy.'
),
default=120,
default=30,
type=int,
),
click.option(
Expand Down Expand Up @@ -284,9 +284,9 @@ def app(address,
config['external_ip'] = listen_host
config['external_port'] = listen_port

retries = max_unresponsive_time / DEFAULT_NAT_KEEPALIVE_RETRIES
config['protocol']['nat_keepalive_retries'] = retries
config['protocol']['nat_keepalive_timeout'] = send_ping_time
config['protocol']['nat_keepalive_retries'] = DEFAULT_NAT_KEEPALIVE_RETRIES
timeout = max_unresponsive_time / DEFAULT_NAT_KEEPALIVE_RETRIES
config['protocol']['nat_keepalive_timeout'] = timeout

address_hex = address_encoder(address) if address else None
address_hex, privatekey_bin = prompt_account(address_hex, keystore_path, password_file)
Expand Down

0 comments on commit 03a0558

Please sign in to comment.