Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information