MCPcopy
hub / github.com/google/seesaw / manager

Method manager

engine/core.go:366–484  ·  view source on GitHub ↗

manager is responsible for managing and co-ordinating various parts of the seesaw engine.

()

Source from the content-addressed store, hash-verified

364// manager is responsible for managing and co-ordinating various parts of the
365// seesaw engine.
366func (e *Engine) manager() {
367 for {
368 // process ha state updates first before processing others
369 select {
370 case state := <-e.haManager.stateChan:
371 log.Infof("Received HA state notification %v", state)
372 e.haManager.setState(state)
373 continue
374 case status := <-e.haManager.statusChan:
375 log.V(1).Infof("Received HA status notification (%v)", status.State)
376 e.haManager.setStatus(status)
377 continue
378 default:
379 }
380 select {
381 case state := <-e.haManager.stateChan:
382 log.Infof("Received HA state notification %v", state)
383 e.haManager.setState(state)
384
385 case status := <-e.haManager.statusChan:
386 log.V(1).Infof("Received HA status notification (%v)", status.State)
387 e.haManager.setStatus(status)
388
389 case n := <-e.notifier.C:
390 log.Infof("Received cluster config notification; %v", &n)
391 e.syncServer.notify(&SyncNote{Type: SNTConfigUpdate, Time: time.Now()})
392
393 vua, err := newVserverUserAccess(n.Cluster)
394 if err != nil {
395 log.Errorf("Ignoring notification due to invalid vserver access configuration: %v", err)
396 return
397 }
398
399 e.clusterLock.Lock()
400 e.cluster = n.Cluster
401 e.clusterLock.Unlock()
402
403 e.vserverAccess.update(vua)
404
405 if n.MetadataOnly {
406 log.Infof("Only metadata changes found, processing complete.")
407 continue
408 }
409
410 if ha, err := e.haConfig(); err != nil {
411 log.Errorf("Manager failed to determine haConfig: %v", err)
412 } else if ha.Enabled {
413 e.haManager.enable()
414 } else {
415 e.haManager.disable()
416 }
417
418 node, err := e.thisNode()
419 if err != nil {
420 log.Errorf("Manager failed to identify local node: %v", err)
421 continue
422 }
423 if !node.VserversEnabled {

Callers 1

RunMethod · 0.95

Implementers 3

EngineClientha/engine_client.go
DummyEngineha/engine_client.go
SeesawEngineengine/ipc.go

Calls 15

haConfigMethod · 0.95
thisNodeMethod · 0.95
shutdownVserversMethod · 0.95
deleteVLANsMethod · 0.95
updateVLANsMethod · 0.95
updateVserversMethod · 0.95
updateARPMapMethod · 0.95
handleOverrideMethod · 0.95
newVserverUserAccessFunction · 0.85
setStatusMethod · 0.80
timerMethod · 0.80
shutdownMethod · 0.80

Tested by

no test coverage detected