Commit 0d4e0aaf authored by duanjinfei's avatar duanjinfei

handlercontainer resp status code is 409

parent 39a1f7e0
......@@ -445,7 +445,11 @@ func (t *TaskHandler) ComputeTaskHandler(taskMsg *nodeManagerV1.PushTaskMessage)
t.ExecTaskIdIsSuccess.Store(taskMsg.TaskId, true)
return
}
if taskExecResult.TaskHttpStatusCode == http.StatusConflict {
taskExecResult.TaskExecError = fmt.Sprintf("%s,Container Http Code:%d,body:%s", "Container is initializing", post.StatusCode, string(all))
} else {
taskExecResult.TaskExecError = fmt.Sprintf("%s,Container Http Code:%d,body:%s", "Container is exec failed", post.StatusCode, string(all))
}
} else {
taskExecResult.TaskExecError = fmt.Sprintf("%s,Container Http Code:%d,body:%s", "Container resp body is nil", post.StatusCode, "")
}
......@@ -689,6 +693,7 @@ func (t *TaskHandler) checkIsStopContainer(taskCmd *models.TaskCmd) {
if container.Image == oldTaskImageName && container.State == "running" {
t.DockerOp.StopContainer(container.ID)
log.WithField("Image name", container.Image).Info("Stopping container")
//t.DockerOp.RunningImages[oldTaskImageName] = false
break
}
}
......
......@@ -30,6 +30,7 @@ type DockerOp struct {
ModelsInfo []*models.ModelInfo
ModelTaskIdIndexesChan chan []uint64
ReportTaskIds []uint64
//RunningImages map[string]bool
}
func init() {
......@@ -53,6 +54,7 @@ func NewDockerOp() *DockerOp {
UsedExternalPort: make(map[int64]bool, 0),
ModelTaskIdIndexesChan: make(chan []uint64, 0),
ReportTaskIds: make([]uint64, 0),
//RunningImages: make(map[string]bool, 0),
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment