Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
6354f260
Commit
6354f260
authored
2 years ago
by
benjamin
Browse files
Options
Downloads
Patches
Plain Diff
minor clean up
parent
c2fccb8a
No related branches found
No related tags found
4 merge requests
!510
Release
,
!419
rewrote the health tracker to both consider if there are waiting rounds and...
,
!407
rewrote the health tracker to both consider if there are waiting rounds and...
,
!340
Project/channels
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmix/health/tracker.go
+15
-2
15 additions, 2 deletions
cmix/health/tracker.go
with
15 additions
and
2 deletions
cmix/health/tracker.go
+
15
−
2
View file @
6354f260
...
...
@@ -164,10 +164,18 @@ func (t *tracker) StartProcesses() (stoppable.Stoppable, error) {
// health.
func
(
t
*
tracker
)
start
(
stop
*
stoppable
.
Single
)
{
// ensures wasHealthy is only set once
hasSetWasHealthy
:=
false
// denotation of the previous state in order to catch state changes
lastState
:=
false
// flag denoting required exit, allows final signaling
quit
:=
false
//ensured the timeout error is only printed once per timeout period
timedOut
:=
true
for
{
/* wait for an event */
...
...
@@ -181,9 +189,14 @@ func (t *tracker) start(stop *stoppable.Single) {
case
heartbeat
:=
<-
t
.
heartbeat
:
t
.
updateHealth
(
heartbeat
.
HasWaitingRound
,
heartbeat
.
IsRoundComplete
)
timedOut
=
false
case
<-
time
.
After
(
t
.
timeout
)
:
if
!
timedOut
{
jww
.
ERROR
.
Printf
(
"Network health tracker timed out, network "
+
"is no longer healthy, follower likely has stopped..."
)
}
timedOut
=
true
// note: no need to force to unhealthy because by definition the
// timestamps will be stale
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment