-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add node health #1811
Add node health #1811
Conversation
src/neo/Network/P2P/TaskManager.cs
Outdated
@@ -243,8 +261,13 @@ private void OnTimer() | |||
if (TimeProvider.Current.UtcNow - kvp.Value > TaskTimeout) | |||
{ | |||
session.IndexTasks.Remove(kvp.Key); | |||
session.TimeoutTimes++; | |||
AssignSyncTask(kvp.Key, session); | |||
if (++session.TimeoutTimes > 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never reduce TimeoutTimes
? what's happend if at the begining we have two, in one day we have one, and in a week, we have another one, we terminate the session, and the node could be healthy, we should expire his bad rates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, maybe we can reduce TimeoutTimes by one every day.
else if (message_count > 1000) | ||
{ | ||
message_count = 0; | ||
if ((TimeProvider.Current.UtcNow - start_message_time).TotalMilliseconds < time_threshold) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a threshold for receive, but not for send, what happens if it's a normal behaviour be fast?
@ShawnYun Are you still working on this? |
Close #1679
Modified the weight calculation method.
The relevant parameters may need to be discussed.