service_controller: Include service key in error messages

This commit is contained in:
Zihong Zheng 2017-10-24 10:51:15 -07:00
parent 7d4f21d0d7
commit e3eac372f0

View File

@ -759,7 +759,7 @@ func (s *ServiceController) syncService(key string) error {
if retryDelay != 0 {
// Add the failed service back to the queue so we'll retry it.
glog.Errorf("Failed to process service. Retrying in %s: %v", retryDelay, err)
glog.Errorf("Failed to process service %v. Retrying in %s: %v", key, retryDelay, err)
go func(obj interface{}, delay time.Duration) {
// put back the service key to working queue, it is possible that more entries of the service
// were added into the queue during the delay, but it does not mess as when handling the retry,
@ -767,7 +767,7 @@ func (s *ServiceController) syncService(key string) error {
s.workingQueue.AddAfter(obj, delay)
}(key, retryDelay)
} else if err != nil {
runtime.HandleError(fmt.Errorf("Failed to process service. Not retrying: %v", err))
runtime.HandleError(fmt.Errorf("Failed to process service %v. Not retrying: %v", key, err))
}
return nil
}