Sync Committee: Heartbeat + Worker Metrics#837
Merged
Conversation
3f923fe to
82af843
Compare
Refactor `Worker`'s initialization and logging, introduce `HeartbeatSender` * Implemented a new `HeartbeatSender` worker updating the new heartbeat counter metric with a static interval; * Integrated logger and basic metrics into `srv.WorkerLoop` to mandatorily log unhandled errors and publish error-related metrics; Other changes: * Increased the default task polling interval from `1 sec` to `10 sec` to reduce the number of requests between nodes; * Removed unused interfaces, renamed a couple of types;
82af843 to
f56e4aa
Compare
oclaw
approved these changes
May 2, 2025
Contributor
oclaw
left a comment
There was a problem hiding this comment.
LGTM, but a bit of unification will make it even better :)
| p.metrics.RecordError(ctx, p.Name()) | ||
| err := p.updateStateIfReady(ctx) | ||
|
|
||
| if err == nil || errors.Is(err, context.Canceled) { |
Contributor
There was a problem hiding this comment.
Looks like some common part between workers. Let's wrap it with some runWorkerIteration func like
func runWorkerIteration(worker func() error, label string, ignoredErrors ...err)
And put this condition inside
Contributor
Author
There was a problem hiding this comment.
Good point, introduced srv.workerIteration
akokoshn
approved these changes
May 4, 2025
Refactor worker iteration logic and adjusted `concurrent.Suspendable` * Introduced a unified `workerIteration` abstraction reused by `WorkerLoop`, `Aggregator` and `Proposer` * Updated `Suspendable` behavior to handle errors properly * Simplified `Aggregator` and `Proposer` by embedding `Suspendable` directly into them * Adjusted logging in `Service`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sync Committee: Heartbeat + Worker Metrics
Refactor
Worker's initialization and logging, introduceHeartbeatSenderHeartbeatSenderworker updating the new heartbeat counter metric with a static interval;srv.WorkerLoopto mandatorily log unhandled errors and publish error-related metrics;Other changes:
1 secto10 secto reduce the number of requests between nodes;