engine: resources: Disable buggy restart code
This was really not ever tested properly, and I worry it will deadlock. It definitely kicks off falls positives that don't even do any harm as far as we can tell.
This commit is contained in:
@@ -140,7 +140,7 @@ type VirtRes struct {
|
|||||||
restartScheduled bool // do we need to schedule a hard restart?
|
restartScheduled bool // do we need to schedule a hard restart?
|
||||||
|
|
||||||
// XXX: misc junk which we may wish to rewrite
|
// XXX: misc junk which we may wish to rewrite
|
||||||
processExitWatch bool // do we want to wait on an explicit process exit?
|
//processExitWatch bool // do we want to wait on an explicit process exit?
|
||||||
processExitChan chan struct{}
|
processExitChan chan struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ func (obj *VirtRes) Watch(ctx context.Context) error {
|
|||||||
|
|
||||||
send := false // send event?
|
send := false // send event?
|
||||||
for {
|
for {
|
||||||
processExited := false // did the process exit fully (shutdown)?
|
//processExited := false // did the process exit fully (shutdown)?
|
||||||
select {
|
select {
|
||||||
case event, ok := <-domChan:
|
case event, ok := <-domChan:
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -381,7 +381,7 @@ func (obj *VirtRes) Watch(ctx context.Context) error {
|
|||||||
if obj.State != "shutoff" {
|
if obj.State != "shutoff" {
|
||||||
send = true
|
send = true
|
||||||
}
|
}
|
||||||
processExited = true
|
//processExited = true
|
||||||
|
|
||||||
case libvirt.DOMAIN_EVENT_PMSUSPENDED:
|
case libvirt.DOMAIN_EVENT_PMSUSPENDED:
|
||||||
// FIXME: IIRC, in s3 we can't cold change
|
// FIXME: IIRC, in s3 we can't cold change
|
||||||
@@ -390,13 +390,13 @@ func (obj *VirtRes) Watch(ctx context.Context) error {
|
|||||||
fallthrough
|
fallthrough
|
||||||
case libvirt.DOMAIN_EVENT_CRASHED:
|
case libvirt.DOMAIN_EVENT_CRASHED:
|
||||||
send = true
|
send = true
|
||||||
processExited = true // FIXME: is this okay for PMSUSPENDED ?
|
//processExited = true // FIXME: is this okay for PMSUSPENDED ?
|
||||||
}
|
}
|
||||||
|
|
||||||
if obj.processExitWatch && processExited {
|
//if obj.processExitWatch && processExited {
|
||||||
close(obj.processExitChan) // send signal
|
// close(obj.processExitChan) // send signal
|
||||||
obj.processExitWatch = false
|
// obj.processExitWatch = false
|
||||||
}
|
//}
|
||||||
|
|
||||||
case agentEvent, ok := <-gaChan:
|
case agentEvent, ok := <-gaChan:
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -714,8 +714,9 @@ func (obj *VirtRes) domainShutdownSync(apply bool, dom *libvirt.Domain) (bool, e
|
|||||||
if !apply {
|
if !apply {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
obj.processExitWatch = true
|
//obj.processExitWatch = true
|
||||||
obj.processExitChan = make(chan struct{})
|
//obj.processExitChan = make(chan struct{})
|
||||||
|
|
||||||
// if machine shuts down before we call this, we error;
|
// if machine shuts down before we call this, we error;
|
||||||
// this isn't ideal, but it happened due to user error!
|
// this isn't ideal, but it happened due to user error!
|
||||||
obj.init.Logf("running shutdown")
|
obj.init.Logf("running shutdown")
|
||||||
@@ -840,15 +841,15 @@ func (obj *VirtRes) CheckApply(ctx context.Context, apply bool) (bool, error) {
|
|||||||
|
|
||||||
// shutdown here and let the stateCheckApply fix things up...
|
// shutdown here and let the stateCheckApply fix things up...
|
||||||
// TODO: i think this is the most straight forward process...
|
// TODO: i think this is the most straight forward process...
|
||||||
if !obj.absent && restart {
|
//if !obj.absent && restart {
|
||||||
if c, err := obj.domainShutdownSync(apply, dom); err != nil {
|
// if c, err := obj.domainShutdownSync(apply, dom); err != nil {
|
||||||
return false, errwrap.Wrapf(err, "domainShutdownSync failed")
|
// return false, errwrap.Wrapf(err, "domainShutdownSync failed")
|
||||||
|
//
|
||||||
} else if !c {
|
// } else if !c {
|
||||||
checkOK = false
|
// checkOK = false
|
||||||
restart = false // clear the restart requirement...
|
// restart = false // clear the restart requirement...
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
// FIXME: is doing this early check (therefore twice total) a good idea?
|
// FIXME: is doing this early check (therefore twice total) a good idea?
|
||||||
// run additional preemptive attr change checks here for hotplug stuff!
|
// run additional preemptive attr change checks here for hotplug stuff!
|
||||||
|
|||||||
Reference in New Issue
Block a user