We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fe1b54 commit 2545789Copy full SHA for 2545789
packages/middleware-endpoint-discovery/src/updateDiscoveredEndpointInCache.ts
@@ -54,10 +54,11 @@ export const updateDiscoveredEndpointInCache = async (
54
resolve();
55
})
56
.catch((error: any) => {
57
- if (error.name === "InvalidEndpointException" || error.$metadata?.httpStatusCode === 421) {
58
- // Endpoint is invalid, delete the cache entry.
59
- endpointCache.delete(cacheKey);
60
- }
+ // The cache entry must be deleted
+ // 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.
61
+ endpointCache.delete(cacheKey);
62
63
const errorToThrow = Object.assign(
64
new Error(
0 commit comments