@@ -265,7 +265,7 @@ func (dbo *DBOrchestratorPoolCache) cacheDBOrchs() error {
265265 return fmt .Errorf ("could not retrieve orchestrators from DB: %v" , err )
266266 }
267267
268- resc , errc := make (chan * common.DBOrch , len (orchs )), make (chan error , len (orchs ))
268+ resc , errc , skipped := make (chan * common.DBOrch , len (orchs )), make (chan error , len ( orchs )), make ( chan int , len (orchs ))
269269 timeout := getOrchestratorTimeoutLoop //needs to be same or longer than GRPCConnectTimeout in server/rpc.go
270270 ctx , cancel := context .WithTimeout (context .Background (), timeout )
271271 defer cancel ()
@@ -276,7 +276,11 @@ func (dbo *DBOrchestratorPoolCache) cacheDBOrchs() error {
276276 errc <- err
277277 return
278278 }
279-
279+ //do not connect if URI host is not set
280+ if uri .Host == "" {
281+ skipped <- 1
282+ return
283+ }
280284 info , err := serverGetOrchInfo (ctx , dbo .bcast , uri , nil )
281285 if err != nil {
282286 errc <- err
@@ -311,6 +315,7 @@ func (dbo *DBOrchestratorPoolCache) cacheDBOrchs() error {
311315 }
312316
313317 numOrchs := 0
318+ skippedOrchs := 0
314319 for _ , orch := range orchs {
315320 if orch == nil {
316321 continue
@@ -325,10 +330,12 @@ func (dbo *DBOrchestratorPoolCache) cacheDBOrchs() error {
325330 if err := dbo .store .UpdateOrch (res ); err != nil {
326331 glog .Error ("Error updating Orchestrator in DB: " , err )
327332 }
333+ case <- skipped :
334+ skippedOrchs += 1
328335 case err := <- errc :
329336 glog .Errorln (err )
330337 case <- ctx .Done ():
331- glog .Info ("Done fetching orch info for orchestrators, context timeout" )
338+ glog .Infof ("Done fetching orch info for orchestrators, context timeout (skipped: %v)" , skippedOrchs )
332339 return nil
333340 }
334341 }
0 commit comments