Consume full task sync ACS responders from ecs-agent/ #3854
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Consume the task manifest responder and task stop verification ACK responder defined in ecs-agent module. These ACS message responders are used to support the full task sync feature.
Implementation details
Please note that, in the context of this PR, "ACS message responder"/"responder" is more or less synonymous with "ACS message handler"/"handler".
agent/acs/handler/task_manifest_responder.go
and inside that file, implementTaskComparer
andSequenceNumberAccessor
interfaces defined in ecs-agent module. Some parts of the implementation are based off of functionality that exists in the currentagent/acs/handler/task_manifest_handler.go
fileagent/acs/handler/task_stop_verification_ack_responder.go
and inside that file, implementTaskStopper
interface defined in ecs-agent module. Some parts of the implementation are based off of functionality that exists in the currentagent/acs/handler/task_manifest_handler.go
fileagent/acs/handler/task_manifest_responder_test.go
andagent/acs/handler/task_stop_verification_ack_responder_test.go
. Some tests are based off of tests that exist in the currentagent/acs/handler/task_manifest_handler_test.go
fileagent/acs/handler/task_manifest_handler.go
andagent/acs/handler/task_manifest_handler_test.go
agent/acs/handler/acs_handler.go
:HandlerFunc
function as a request handler to the ACS client, such that task manifest responder dictates what to do in response to receiving task manifest messages from ACSHandlerFunc
function as a request handler to the ACS client, such that task stop verification ACK responder dictates what to do in response to receiving task stop verification ACKs from ACSnil
as the respond function parameter. This is because although the task stop verification ACK responder in ecs-agent module currently takes in and contains a respond function parameter, it actually doesn't use it since we do not send anything back to ACS in response to task stop verification ACKs. I've left removing this non-necessity from the task stop verification ACK responder in the ecs-agent module out of scope of this pull request as this pull request is limited to and focuses on changes in the agent moduleagent/acs/handler/task_manifest_handler.go
) and the responders in the ecs-agent module factor out this non-necessity and are a lot cleaner and simpler to follow.For reference see the following PR for a similar change previously made to the heartbeat responder for the same reason: Fix flakey leak test for ACS Handler #3232
Testing
Unit, integration, and functional tests.
New tests cover the changes: yes
Description for the changelog
Consume full task sync ACS responders from ecs-agent/
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.