Skip to content

Commit

Permalink
Merged PR 546549: Update StackExchange.Redis to 2.1.30
Browse files Browse the repository at this point in the history
This PR updates `Redis.StackExchange` library to version 2.1.30 to include a fix that supposedly solves the problem with the inability of a process to connect to Redis instance.

This is the PR that this version includes: StackExchange/StackExchange.Redis#1374

We do have many cases when the process fails to connect to on Redis instance and after the service restart it immediately (within seconds) successfully connects to it.

Related work items: #1697377
  • Loading branch information
SergeyTeplyakov committed Apr 15, 2020
1 parent 0f59d16 commit 5a67deb
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,15 @@ namespace DistributedTest {
importFrom("Microsoft.Azure.Amqp").pkg,
importFrom("Microsoft.Azure.Services.AppAuthentication").pkg,
importFrom("Microsoft.IdentityModel.Clients.ActiveDirectory").pkg,
importFrom("System.IdentityModel.Tokens.Jwt").pkg
importFrom("System.IdentityModel.Tokens.Jwt").pkg,
importFrom("Microsoft.Bcl.AsyncInterfaces").pkg
),
...addIf(!BuildXLSdk.isFullFramework,
// Workaround to avoid compilation issues due to duplicate definition of IAsyncEnumerable<T>
// Redis.StackExchange package references .netstandard2 and the tests are running under .NET Core App 3.1
// and Microsoft.Bcl.AsyncInterfaces package was changed between .netstandard2 and .netstandard2.1
importFrom("Microsoft.Bcl.AsyncInterfaces").withQualifier({targetFramework: "netstandard2.1"}).pkg),
...redisPackages,
Distributed.dll,
...Distributed.eventHubPackagages,
UtilitiesCore.dll,
Expand All @@ -46,7 +53,6 @@ namespace DistributedTest {
importFrom("Grpc.Core.Api").pkg,
...importFrom("Sdk.Selfhost.RocksDbSharp").pkgs,

importFrom("StackExchange.Redis").pkg,
...BuildXLSdk.fluentAssertionsWorkaround,

importFrom("WindowsAzure.Storage").pkg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace ContentStoreTest.Distributed.Redis
{
internal class TestDatabase : IDatabaseAsync, IBatch, IDatabase
internal class TestDatabase : IBatch, IDatabase
{
private readonly ITestRedisDatabase _testDb;
private readonly IBatch _testBatch;
Expand All @@ -20,6 +20,8 @@ public TestDatabase(ITestRedisDatabase testDb, IBatch testBatch = null)
_testBatch = testBatch;
}

public long KeyTouch(RedisKey[] keys, CommandFlags flags = CommandFlags.None) => 0;

public int Database => throw new NotImplementedException();

IConnectionMultiplexer IRedisAsync.Multiplexer => throw new NotImplementedException();
Expand Down Expand Up @@ -310,6 +312,15 @@ public Task<long> HashLengthAsync(RedisKey key, CommandFlags flags = CommandFlag
throw new NotImplementedException();
}

public global::System.Collections.Generic.IAsyncEnumerable<HashEntry> HashScanAsync(
RedisKey key,
RedisValue pattern = new RedisValue(),
int pageSize = 250,
long cursor = 0,
int pageOffset = 0,
CommandFlags flags = CommandFlags.None) =>
throw new NotImplementedException();

public IEnumerable<HashEntry> HashScan(RedisKey key, RedisValue pattern, int pageSize, CommandFlags flags)
{
throw new NotImplementedException();
Expand All @@ -330,6 +341,8 @@ public bool HashSet(RedisKey key, RedisValue hashField, RedisValue value, When w
throw new NotImplementedException();
}

public long HashStringLength(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) => 0;

public Task HashSetAsync(RedisKey key, HashEntry[] hashFields, CommandFlags flags = CommandFlags.None)
{
throw new NotImplementedException();
Expand All @@ -340,6 +353,8 @@ public Task<bool> HashSetAsync(RedisKey key, RedisValue hashField, RedisValue va
return _testDb.HashSetAsync(key, hashField, value, when, flags);
}

public Task<long> HashStringLengthAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) => null;

public RedisValue[] HashValues(RedisKey key, CommandFlags flags = CommandFlags.None)
{
throw new NotImplementedException();
Expand Down Expand Up @@ -1265,6 +1280,24 @@ public Task<long> SortedSetRemoveRangeByValueAsync(RedisKey key, RedisValue min,
throw new NotImplementedException();
}

public global::System.Collections.Generic.IAsyncEnumerable<RedisValue> SetScanAsync(
RedisKey key,
RedisValue pattern = new RedisValue(),
int pageSize = 250,
long cursor = 0,
int pageOffset = 0,
CommandFlags flags = CommandFlags.None) =>
throw new NotImplementedException();

public global::System.Collections.Generic.IAsyncEnumerable<SortedSetEntry> SortedSetScanAsync(
RedisKey key,
RedisValue pattern = new RedisValue(),
int pageSize = 250,
long cursor = 0,
int pageOffset = 0,
CommandFlags flags = CommandFlags.None) =>
throw new NotImplementedException();

public IEnumerable<SortedSetEntry> SortedSetScan(RedisKey key, RedisValue pattern, int pageSize, CommandFlags flags)
{
throw new NotImplementedException();
Expand Down Expand Up @@ -1370,11 +1403,21 @@ public bool StreamCreateConsumerGroup(RedisKey key, RedisValue groupName, RedisV
throw new NotImplementedException();
}

public bool StreamCreateConsumerGroup(RedisKey key, RedisValue groupName, RedisValue? position = null, bool createStream = true, CommandFlags flags = CommandFlags.None) => false;

public Task<bool> StreamCreateConsumerGroupAsync(RedisKey key, RedisValue groupName, RedisValue? position = null, CommandFlags flags = CommandFlags.None)
{
throw new NotImplementedException();
}

public Task<bool> StreamCreateConsumerGroupAsync(
RedisKey key,
RedisValue groupName,
RedisValue? position = null,
bool createStream = true,
CommandFlags flags = CommandFlags.None) =>
null;

public long StreamDelete(RedisKey key, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None)
{
throw new NotImplementedException();
Expand Down Expand Up @@ -1490,21 +1533,59 @@ public StreamEntry[] StreamReadGroup(RedisKey key, RedisValue groupName, RedisVa
throw new NotImplementedException();
}

public StreamEntry[] StreamReadGroup(
RedisKey key,
RedisValue groupName,
RedisValue consumerName,
RedisValue? position = null,
int? count = null,
bool noAck = false,
CommandFlags flags = CommandFlags.None) =>
new StreamEntry[] { };

public RedisStream[] StreamReadGroup(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream = null, CommandFlags flags = CommandFlags.None)
{
throw new NotImplementedException();
}

public RedisStream[] StreamReadGroup(
StreamPosition[] streamPositions,
RedisValue groupName,
RedisValue consumerName,
int? countPerStream = null,
bool noAck = false,
CommandFlags flags = CommandFlags.None) =>
new RedisStream[] { };

public Task<StreamEntry[]> StreamReadGroupAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position = null, int? count = null, CommandFlags flags = CommandFlags.None)
{
throw new NotImplementedException();
}

public Task<StreamEntry[]> StreamReadGroupAsync(
RedisKey key,
RedisValue groupName,
RedisValue consumerName,
RedisValue? position = null,
int? count = null,
bool noAck = false,
CommandFlags flags = CommandFlags.None) =>
null;

public Task<RedisStream[]> StreamReadGroupAsync(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream = null, CommandFlags flags = CommandFlags.None)
{
throw new NotImplementedException();
}

public Task<RedisStream[]> StreamReadGroupAsync(
StreamPosition[] streamPositions,
RedisValue groupName,
RedisValue consumerName,
int? countPerStream = null,
bool noAck = false,
CommandFlags flags = CommandFlags.None) =>
null;

public long StreamTrim(RedisKey key, int maxLength, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None)
{
throw new NotImplementedException();
Expand Down Expand Up @@ -1727,11 +1808,17 @@ public RedisValue StringSetRange(RedisKey key, long offset, RedisValue value, Co
throw new NotImplementedException();
}

public bool KeyTouch(RedisKey key, CommandFlags flags = CommandFlags.None) => false;

public Task<RedisValue> StringSetRangeAsync(RedisKey key, long offset, RedisValue value, CommandFlags flags = CommandFlags.None)
{
return _testDb.StringSetRangeAsync(key, offset, value);
}

public Task<bool> KeyTouchAsync(RedisKey key, CommandFlags flags = CommandFlags.None) => null;

public Task<long> KeyTouchAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) => null;

public bool TryWait(Task task)
{
throw new NotImplementedException();
Expand Down
14 changes: 7 additions & 7 deletions cg/nuget/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2643,7 +2643,7 @@
"Type": "NuGet",
"NuGet": {
"Name": "Pipelines.Sockets.Unofficial",
"Version": "2.0.22"
"Version": "2.1.6"
}
}
},
Expand Down Expand Up @@ -2724,7 +2724,7 @@
"Type": "NuGet",
"NuGet": {
"Name": "StackExchange.Redis",
"Version": "2.0.601"
"Version": "2.1.30"
}
}
},
Expand Down Expand Up @@ -3030,7 +3030,7 @@
"Type": "NuGet",
"NuGet": {
"Name": "System.Diagnostics.PerformanceCounter",
"Version": "4.5.0"
"Version": "4.7.0"
}
}
},
Expand Down Expand Up @@ -3228,7 +3228,7 @@
"Type": "NuGet",
"NuGet": {
"Name": "System.IO.Pipelines",
"Version": "4.5.3"
"Version": "4.7.0"
}
}
},
Expand Down Expand Up @@ -3615,7 +3615,7 @@
"Type": "NuGet",
"NuGet": {
"Name": "System.Runtime.CompilerServices.Unsafe",
"Version": "4.5.0"
"Version": "4.5.2"
}
}
},
Expand All @@ -3624,7 +3624,7 @@
"Type": "NuGet",
"NuGet": {
"Name": "System.Runtime.CompilerServices.Unsafe",
"Version": "4.5.2"
"Version": "4.7.0"
}
}
},
Expand Down Expand Up @@ -3993,7 +3993,7 @@
"Type": "NuGet",
"NuGet": {
"Name": "System.Threading.Channels",
"Version": "4.5.0"
"Version": "4.7.0"
}
}
},
Expand Down
16 changes: 8 additions & 8 deletions config.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ config({
{ id: "Microsoft.Bcl.Async", version: "1.0.168" },
{ id: "Microsoft.Bcl.AsyncInterfaces", version: "1.1.0" },
{ id: "Microsoft.Bcl.Build", version: "1.0.14" },
{ id: "StackExchange.Redis", version: "2.0.601",
dependentPackageIdsToSkip: ["System.IO.Pipelines", "System.Threading.Channels"] },
{ id: "Pipelines.Sockets.Unofficial", version: "2.0.22",
dependentPackageIdsToSkip: ["System.IO.Pipelines", "System.Runtime.CompilerServices.Unsafe"] },
{ id: "System.Diagnostics.PerformanceCounter", version: "4.5.0" },
{ id: "System.Threading.Channels", version: "4.5.0",
{ id: "StackExchange.Redis", version: "2.1.30",
dependentPackageIdsToSkip: ["System.IO.Pipelines", "System.Threading.Channels", "Microsoft.Bcl.AsyncInterfaces"] },
{ id: "Pipelines.Sockets.Unofficial", version: "2.1.6",
dependentPackageIdsToSkip: ["System.IO.Pipelines", "System.Runtime.CompilerServices.Unsafe", "Microsoft.Bcl.AsyncInterfaces"] },
{ id: "System.Diagnostics.PerformanceCounter", version: "4.7.0" },
{ id: "System.Threading.Channels", version: "4.7.0",
dependentPackageIdsToSkip: ["System.Threading.Tasks.Extensions"] },
{ id: "System.Interactive.Async", version: "3.1.1" },
{ id: "TransientFaultHandling.Core", version: "5.1.1209.1" },
Expand All @@ -238,8 +238,8 @@ config({
{ id: "Microsoft.ApplicationInsights.WindowsServer", version: "2.3.0" },
{ id: "Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel", version: "2.3.0" },
{ id: "System.Memory", version: "4.5.1" },
{ id: "System.Runtime.CompilerServices.Unsafe", version: "4.5.0" },
{ id: "System.IO.Pipelines", version: "4.5.3",
{ id: "System.Runtime.CompilerServices.Unsafe", version: "4.7.0" },
{ id: "System.IO.Pipelines", version: "4.7.0",
dependentPackageIdsToSkip: ["System.Threading.Tasks.Extensions"] },
{ id: "System.Security.Cryptography.Xml", version: "4.5.0" },
{ id: "System.Text.Encodings.Web", version: "4.5.0" },
Expand Down

0 comments on commit 5a67deb

Please sign in to comment.