aboutsummaryrefslogtreecommitdiffstats
path: root/vm/gce
diff options
context:
space:
mode:
Diffstat (limited to 'vm/gce')
-rw-r--r--vm/gce/gce.go49
1 files changed, 21 insertions, 28 deletions
diff --git a/vm/gce/gce.go b/vm/gce/gce.go
index 1bdf83444..cc2cd62cd 100644
--- a/vm/gce/gce.go
+++ b/vm/gce/gce.go
@@ -49,17 +49,16 @@ type Pool struct {
}
type instance struct {
- env *vmimpl.Env
- cfg *Config
- GCE *gce.Context
- debug bool
- name string
- ip string
- gceKey string // per-instance private ssh key associated with the instance
- sshKey string // ssh key
- sshUser string
- closed chan bool
- diagnose chan bool
+ env *vmimpl.Env
+ cfg *Config
+ GCE *gce.Context
+ debug bool
+ name string
+ ip string
+ gceKey string // per-instance private ssh key associated with the instance
+ sshKey string // ssh key
+ sshUser string
+ closed chan bool
}
func ctor(env *vmimpl.Env) (vmimpl.Pool, error) {
@@ -172,17 +171,16 @@ func (pool *Pool) Create(workdir string, index int) (vmimpl.Instance, error) {
}
ok = true
inst := &instance{
- env: pool.env,
- cfg: pool.cfg,
- debug: pool.env.Debug,
- GCE: pool.GCE,
- name: name,
- ip: ip,
- gceKey: gceKey,
- sshKey: sshKey,
- sshUser: sshUser,
- closed: make(chan bool),
- diagnose: make(chan bool, 1),
+ env: pool.env,
+ cfg: pool.cfg,
+ debug: pool.env.Debug,
+ GCE: pool.GCE,
+ name: name,
+ ip: ip,
+ gceKey: gceKey,
+ sshKey: sshKey,
+ sshUser: sshUser,
+ closed: make(chan bool),
}
return inst, nil
}
@@ -316,6 +314,7 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin
}
go func() {
+ retry:
select {
case <-time.After(timeout):
signal(vmimpl.ErrTimeout)
@@ -323,8 +322,6 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin
signal(vmimpl.ErrTimeout)
case <-inst.closed:
signal(fmt.Errorf("instance closed"))
- case <-inst.diagnose:
- ssh.Process.Kill()
case err := <-merger.Err:
con.Process.Kill()
ssh.Process.Kill()
@@ -360,10 +357,6 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin
}
func (inst *instance) Diagnose() bool {
- select {
- case inst.diagnose <- true:
- default:
- }
return false
}