Skip to content

Commit

Permalink
add delay before sending TaskStopVerification message
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Jul 10, 2024
1 parent 0a1a88d commit f6dc5d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions agent/engine/task_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ func (mtask *managedTask) handleDesiredStatusChange(desiredStatus apitaskstatus.
field.DesiredStatus: desiredStatus.String(),
field.Sequence: seqnum,
})
logger.Info("Sleeping 45 seconds before applying acs transition")
time.Sleep(45 * time.Second)
if desiredStatus <= mtask.GetDesiredStatus() {
logger.Debug("Redundant task transition; ignoring", logger.Fields{
field.TaskID: mtask.GetID(),
Expand Down
3 changes: 3 additions & 0 deletions ecs-agent/acs/session/task_manifest_responder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package session
import (
"fmt"
"sync"
"time"

"github.com/aws/amazon-ecs-agent/ecs-agent/acs/model/ecsacs"
"github.com/aws/amazon-ecs-agent/ecs-agent/logger"
Expand Down Expand Up @@ -176,6 +177,8 @@ func (tmr *taskManifestResponder) sendTaskStopVerification(message *ecsacs.TaskM
if len(tasksToStop) == 0 {
return
}
logger.Info("sleeping 30 seconds before sending TaskStopVerification message")
time.Sleep(30 * time.Second)
// Create a list of stop candidates to send one debug message.
var taskARNList []string
for _, task := range tasksToStop {
Expand Down

0 comments on commit f6dc5d3

Please sign in to comment.