Adding more info to error msgs

pull/6/head
HAI HUANG 2016-02-23 15:27:13 -05:00
parent f5082b6dd7
commit 625e0d0944
2 changed files with 9 additions and 0 deletions

View File

@ -122,6 +122,12 @@ func New(config Config) Framework {
// the node must be registered and have up-to-date labels
n := config.LookupNode(o.GetHostname())
if n == nil || !node.IsUpToDate(n, node.SlaveAttributesToLabels(o.GetAttributes())) {
if n == nil {
log.V(1).Infof("cannot find node %v", o.GetHostname())
} else {
log.V(1).Infof("node %v's attributes do not match: %v != %v",
o.GetHostname(), n.Labels, o.GetAttributes())
}
return false
}
@ -130,12 +136,14 @@ func New(config Config) Framework {
case eids > 1:
// at most one executor id expected. More than one means that
// the given node is seriously in trouble.
log.V(1).Infof("at most one executor id is expected, but got %v (%v)", eids, o.GetExecutorIds())
return false
case eids == 1:
// the executor id must match, otherwise the running executor
// is incompatible with the current scheduler configuration.
if eid := o.GetExecutorIds()[0]; eid.GetValue() != config.ExecutorId.GetValue() {
log.V(1).Infof("executor ids do not match: %v != %v", eid.GetValue(), config.ExecutorId.GetValue())
return false
}
}

View File

@ -495,6 +495,7 @@ func (s *SchedulerServer) prepareExecutorInfo(hks hyperkube.Interface) (*mesos.E
// running executors in a cluster.
execInfo.ExecutorId = executorinfo.NewID(execInfo)
execInfo.Data = data
log.V(1).Infof("started with executor id %v", execInfo.ExecutorId.GetValue())
return execInfo, nil
}