-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Synchronize calls to DiscoverPollEndpoint (#4504)
* test: reproduce DiscoverPollEndpoint race condition * add: synchronize calls to DiscoverPollEndpoint Agents that share ECSClients can call DiscoverPollEndpoint (DPE) multiple times per task. Each routine that calls DPE will first check the cache before performing the actual API call over the network. The intention here is that only one actual API call is performed (by the first routine to call DPE). However, it is possible for multiple routines to race and effectively make many actual API calls. This is because the `pollEndpointCache` is only updated when the first API call _returns_. This change enforces the intended behavior by making subsequent routines wait for the cache to be updated (or not) by the first thread, eliminating simultaneous calls to DPE. --------- Co-authored-by: Isaac Feldman <icf@amazon.com>
- Loading branch information
Showing
7 changed files
with
108 additions
and
17 deletions.
There are no files selected for viewing
11 changes: 10 additions & 1 deletion
11
agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/api/ecs/client/ecs_client.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/api/ecs/interface.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/api/ecs/mocks/api_mocks.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.