Skip to content

fix(endpoint-discovery): delete failed cache entry in blocking operations #4011

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

Merged
merged 1 commit into from
Oct 3, 2022

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Oct 3, 2022

In blocking operations where discovered endpoint is required, the updateDiscoveredEndpointInCache function must resolve or reject.

Because the function enters a waiting state if it discovers a cached but incomplete endpoint, it could incorrectly wait indefinitely if the incomplete endpoint is the result of a failed request.

@kuhe kuhe requested a review from a team as a code owner October 3, 2022 17:07
@kuhe kuhe force-pushed the fix/endpoint-discovery branch from 7a324bd to 2545789 Compare October 3, 2022 17:08
// because a subsequent blocking request will be stuck
// in a waiting state if it sees the cache entry
// but we have already flushed the request queue.
endpointCache.delete(cacheKey);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conditional was unnecessary.

  • the cache entry must be deleted in all error cases to unblock the next awaiting request
  • the cache entry placeholder is set below for non-blocking requests anyway

@kuhe kuhe force-pushed the fix/endpoint-discovery branch from 2545789 to b8326d5 Compare October 3, 2022 17:32
@kuhe kuhe merged commit c96ac94 into aws:main Oct 3, 2022
@kuhe kuhe deleted the fix/endpoint-discovery branch October 3, 2022 17:53
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants