-
Notifications
You must be signed in to change notification settings - Fork 202
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
Improve the log message in node #64
Conversation
@@ -163,7 +163,6 @@ func (n *Node) Start(ctx context.Context) error { | |||
|
|||
// Build the socket based on the hostname/IP provided in the CLI | |||
socket := string(core.MakeOperatorSocket(n.Config.Hostname, n.Config.DispersalPort, n.Config.RetrievalPort)) | |||
n.Logger.Info("Registering node with socket", "socket", socket) |
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.
This is misleading: it will not register if RegisterNodeAtStart
is false (which is the default).
@@ -358,6 +358,8 @@ func (n *Node) updateSocketAddress(ctx context.Context, newSocketAddr string) { | |||
} | |||
|
|||
func (n *Node) checkRegisteredNodeIpOnChain(ctx context.Context) { | |||
n.Logger.Info("Start checkRegisteredNodeIpOnChain goroutine in background to subscribe the operator socket change events onchain") |
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.
Here and below: the start of an important routine
@@ -207,12 +207,12 @@ func (n *Node) expireLoop() { | |||
// least have 1 second. | |||
timeLimitSec := uint64(math.Max(float64(n.Config.ExpirationPollIntervalSec)*gcPercentageTime, 1.0)) | |||
numBatchesDeleted, err := n.Store.DeleteExpiredEntries(time.Now().Unix(), timeLimitSec) | |||
n.Logger.Info("GC cycle deleted", "num batches", numBatchesDeleted) | |||
n.Logger.Info("Complete an expiration cycle to remove expired batches", "num expired batches found and removed", numBatchesDeleted) |
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.
Expand what it's doing so it's clear for users reading the log.
node/node.go
Outdated
@@ -193,8 +192,9 @@ func (n *Node) Start(ctx context.Context) error { | |||
} | |||
|
|||
// The expireLoop is a loop that is run once per configured second(s) while the node | |||
// is running. It scans for expirated batches and remove them from the local database. | |||
// is running. It scans for expired batches and remove them from the local database. |
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.
nit: "removes them"
Hi @jianoaix - sharing two requests for our log message improvements:
|
Thanks for feedback, these are good points. |
Why are these changes needed?
Make it more clear what's happening in node based on feedback
Checks