MCPcopy
hub / github.com/google/gvisor / startVerifyLoop

Method startVerifyLoop

runsc/metricserver/metricserver_lifecycle.go:63–83  ·  view source on GitHub ↗

startVerifyLoop runs in the background and periodically calls verify.

(ctx context.Context)

Source from the content-addressed store, hash-verified

61
62// startVerifyLoop runs in the background and periodically calls verify.
63func (m *metricServer) startVerifyLoop(ctx context.Context) error {
64 go func() {
65 ticker := time.NewTicker(verifyLoopInterval)
66 defer ticker.Stop()
67 for ctx.Err() == nil {
68 select {
69 case <-ctx.Done():
70 return
71 case <-m.shutdownCh:
72 log.Infof("Received interrupt signal, shutting down server.")
73 m.mu.Lock()
74 m.shutdownLocked(ctx)
75 m.mu.Unlock()
76 return
77 case <-ticker.C:
78 m.verify(ctx)
79 }
80 }
81 }()
82 return nil
83}
84
85// shutdownLocked shuts down the server. It assumes mu is held.
86func (m *metricServer) shutdownLocked(ctx context.Context) {

Callers 1

RunMethod · 0.95

Calls 8

shutdownLockedMethod · 0.95
verifyMethod · 0.95
InfofFunction · 0.92
StopMethod · 0.65
LockMethod · 0.65
UnlockMethod · 0.65
ErrMethod · 0.45
DoneMethod · 0.45

Tested by

no test coverage detected