mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
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
This commit is contained in:
@@ -252,6 +252,8 @@ func (svc *MasterService) setWorkerNodeOnline(node *models.Node) {
|
||||
return
|
||||
}
|
||||
|
||||
svc.Infof("[TIMING] Starting setWorkerNodeOnline for node[%s]", node.Key)
|
||||
|
||||
oldStatus := node.Status
|
||||
node.Status = constants.NodeStatusOnline
|
||||
node.Active = true
|
||||
@@ -264,6 +266,8 @@ func (svc *MasterService) setWorkerNodeOnline(node *models.Node) {
|
||||
return
|
||||
}
|
||||
|
||||
svc.Infof("[TIMING] Completed database update for node[%s] - Active=%v, Enabled=%v, Status=%s",
|
||||
node.Key, node.Active, node.Enabled, node.Status)
|
||||
svc.Infof("worker node[%s] status changed from '%s' to 'online'", node.Key, oldStatus)
|
||||
|
||||
// send notification if status changed
|
||||
|
||||
@@ -217,9 +217,13 @@ func (svc *Service) processFetchCycle() error {
|
||||
return fmt.Errorf("failed to get current node: %w", err)
|
||||
}
|
||||
|
||||
// Log node status for debugging reconnection issues
|
||||
svc.Debugf("[TIMING] Node status check: Active=%v, Enabled=%v, Status=%s",
|
||||
n.Active, n.Enabled, n.Status)
|
||||
|
||||
// skip if node is not active or enabled
|
||||
if !n.Active || !n.Enabled {
|
||||
return fmt.Errorf("node not active or enabled")
|
||||
return fmt.Errorf("node not active or enabled (active=%v, enabled=%v)", n.Active, n.Enabled)
|
||||
}
|
||||
|
||||
// validate if max runners is reached (max runners = 0 means no limit)
|
||||
|
||||
Reference in New Issue
Block a user