Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 3811e09

Browse files
author
Pete Ness
committed
TEMPORARY WORKAROUND - force 10ms retries. Monitor isn't working the way we expect.
1 parent c00f679 commit 3811e09

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

src/ServiceStack.Redis/PooledRedisClientManager.cs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ private async ValueTask<IRedisClientAsync> GetClientAsync()
240240
var poolTimedOut = false;
241241
var inactivePoolIndex = -1;
242242

243+
var timeoutsTests = 300;
243244
do
244245
{
245246
RedisClient inActiveClient;
@@ -268,19 +269,27 @@ private async ValueTask<IRedisClientAsync> GetClientAsync()
268269
}
269270
}
270271

271-
// Didn't get one, so let's wait a bit for a new one.
272-
if (PoolTimeout.HasValue)
272+
timeoutsTests--;
273+
if (timeoutsTests <= 0)
273274
{
274-
if (!await waitForWriter(PoolTimeout.Value))
275-
{
276-
poolTimedOut = true;
277-
break;
278-
}
279-
}
280-
else
281-
{
282-
await waitForWriter(RecheckPoolAfterMs);
275+
poolTimedOut = true;
276+
break;
283277
}
278+
await Task.Delay(10);
279+
280+
// // Didn't get one, so let's wait a bit for a new one.
281+
// if (PoolTimeout.HasValue)
282+
// {
283+
// if (!await waitForWriter(PoolTimeout.Value))
284+
// {
285+
// poolTimedOut = true;
286+
// break;
287+
// }
288+
// }
289+
// else
290+
// {
291+
// await waitForWriter(RecheckPoolAfterMs);
292+
// }
284293
} while (true); // Just keep repeating until we get a
285294

286295
if (poolTimedOut)

0 commit comments

Comments
 (0)