Skip to content

Commit 6020fef

Browse files
author
Marvin Zhang
committed
chore(node): add timing logs and improve node status diagnostics
- master: add TIMING logs in setWorkerNodeOnline to mark start and completed DB update - handler: log node status for reconnection debugging and include active/enabled values in "node not active or enabled" error
1 parent 49165b2 commit 6020fef

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

core/node/service/master_service.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ func (svc *MasterService) setWorkerNodeOnline(node *models.Node) {
252252
return
253253
}
254254

255+
svc.Infof("[TIMING] Starting setWorkerNodeOnline for node[%s]", node.Key)
256+
255257
oldStatus := node.Status
256258
node.Status = constants.NodeStatusOnline
257259
node.Active = true
@@ -264,6 +266,8 @@ func (svc *MasterService) setWorkerNodeOnline(node *models.Node) {
264266
return
265267
}
266268

269+
svc.Infof("[TIMING] Completed database update for node[%s] - Active=%v, Enabled=%v, Status=%s",
270+
node.Key, node.Active, node.Enabled, node.Status)
267271
svc.Infof("worker node[%s] status changed from '%s' to 'online'", node.Key, oldStatus)
268272

269273
// send notification if status changed

core/task/handler/service.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,13 @@ func (svc *Service) processFetchCycle() error {
217217
return fmt.Errorf("failed to get current node: %w", err)
218218
}
219219

220+
// Log node status for debugging reconnection issues
221+
svc.Debugf("[TIMING] Node status check: Active=%v, Enabled=%v, Status=%s",
222+
n.Active, n.Enabled, n.Status)
223+
220224
// skip if node is not active or enabled
221225
if !n.Active || !n.Enabled {
222-
return fmt.Errorf("node not active or enabled")
226+
return fmt.Errorf("node not active or enabled (active=%v, enabled=%v)", n.Active, n.Enabled)
223227
}
224228

225229
// validate if max runners is reached (max runners = 0 means no limit)

0 commit comments

Comments
 (0)