diff options
| author | Jeff Carr <[email protected]> | 2024-11-01 10:23:49 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-01 10:23:49 -0500 |
| commit | 2c1c3482fe6b55cf8142e1ad9b2aab5813e44c44 (patch) | |
| tree | 8c7cb259685ab87f6db8db3af9ba2c7833c23cd9 | |
| parent | 8b588eeba5606099e7edd76131a20f58b1f36ae5 (diff) | |
working further on handling vm ghosting
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | poll.go | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -108,26 +108,35 @@ func (h *HyperT) pollHypervisor() { d.Current.Hypervisor = h.pb.Hostname } } + + // these are the droplets that don't exist anymore on this hypervisor + // this should mean you ran shutdown within domU for name, t := range h.lastDroplets { dur := time.Since(t) if dur > me.hyperPollDelay { d := me.cluster.FindDropletByName(name) + header := d.SprintHeader() if d == nil { - log.Info("droplet has probably powered down", name, "but findDroplet returned nil") + log.Info(header, "droplet has probably powered down", name, "but findDroplet returned nil") // should delete this from h.lastDroplets continue } + if d.Current.State == pb.DropletState_OFF { + log.Info(header, "droplet timed out and is off. remove from h.lastDroplets[] slice") + continue + } + // everthing below here is dumb and needs to be rethought if d.Current.State != pb.DropletState_UNKNOWN { d.SetState(pb.DropletState_UNKNOWN) - log.Info("set state UNKNOWN here", name) + log.Info(header, "set state UNKNOWN here", name) } if d.Current.State == pb.DropletState_UNKNOWN { if dur > time.Minute*2 { // what this means is the droplet probably wasn't migrated or the migrate failed // where should this be checked? the status needs to be changed to OFF s := pb.FormatDuration(dur) - log.Info("UNKNOWN state for more than 2 minutes (clearing out ?)", name, s) + log.Info(header, "UNKNOWN state for more than 2 minutes (clearing out ?)", name, s) // it might be safe to set the status to OFF here. not really. this poll needs // to be moved somewhere else. there needs to be a new goroutine not tied to the |
