Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip sending internal task events to ECS control plane #3772

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions agent/eventhandler/task_handler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ func (event *sendableEvent) taskShouldBeSent() bool {
return false
}

// internal task state change does not need to be sent
if tevent.Task.IsInternal {
return false
}

// Task event should be sent
if tevent.Task.GetSentStatus() < tevent.Status {
return true
Expand Down
10 changes: 10 additions & 0 deletions agent/eventhandler/task_handler_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ func TestShouldTaskEventBeSent(t *testing.T) {
event *sendableEvent
shouldBeSent bool
}{
{
// We don't send a task event to backend if it is an internal task
event: newSendableTaskEvent(api.TaskStateChange{
Status: apitaskstatus.TaskRunning,
Task: &apitask.Task{
IsInternal: true,
},
}),
shouldBeSent: false,
},
{
// We don't send a task event to backend if task status == NONE
event: newSendableTaskEvent(api.TaskStateChange{
Expand Down