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) ...@@ -445,7 +445,11 @@ func (t *TaskHandler) ComputeTaskHandler(taskMsg *nodeManagerV1.PushTaskMessage)
t.ExecTaskIdIsSuccess.Store(taskMsg.TaskId, true) t.ExecTaskIdIsSuccess.Store(taskMsg.TaskId, true)
return 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)) taskExecResult.TaskExecError = fmt.Sprintf("%s,Container Http Code:%d,body:%s", "Container is exec failed", post.StatusCode, string(all))
}
} else { } else {
taskExecResult.TaskExecError = fmt.Sprintf("%s,Container Http Code:%d,body:%s", "Container resp body is nil", post.StatusCode, "") 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) { ...@@ -689,6 +693,7 @@ func (t *TaskHandler) checkIsStopContainer(taskCmd *models.TaskCmd) {
if container.Image == oldTaskImageName && container.State == "running" { if container.Image == oldTaskImageName && container.State == "running" {
t.DockerOp.StopContainer(container.ID) t.DockerOp.StopContainer(container.ID)
log.WithField("Image name", container.Image).Info("Stopping container") log.WithField("Image name", container.Image).Info("Stopping container")
//t.DockerOp.RunningImages[oldTaskImageName] = false
break break
} }
} }
......
...@@ -30,6 +30,7 @@ type DockerOp struct { ...@@ -30,6 +30,7 @@ type DockerOp struct {
ModelsInfo []*models.ModelInfo ModelsInfo []*models.ModelInfo
ModelTaskIdIndexesChan chan []uint64 ModelTaskIdIndexesChan chan []uint64
ReportTaskIds []uint64 ReportTaskIds []uint64
//RunningImages map[string]bool
} }
func init() { func init() {
...@@ -53,6 +54,7 @@ func NewDockerOp() *DockerOp { ...@@ -53,6 +54,7 @@ func NewDockerOp() *DockerOp {
UsedExternalPort: make(map[int64]bool, 0), UsedExternalPort: make(map[int64]bool, 0),
ModelTaskIdIndexesChan: make(chan []uint64, 0), ModelTaskIdIndexesChan: make(chan []uint64, 0),
ReportTaskIds: make([]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