Commit 2bd10f90 authored by Nick Craver's avatar Nick Craver Committed by GitHub

Merge branch 'master' into patch-1

parents 4157cf1b 786e946d
......@@ -19,3 +19,4 @@ RedisQFork*.dat
StackExchange.Redis.*.zip
.vs/
*.lock.json
packages/
\ No newline at end of file
{
"runtimes": { "win": {} },
"frameworks": {
"net45": {
"dependencies": {
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>9d83baba-a92e-495f-bf63-deb4f6b09355</ProjectGuid>
<RootNamespace>BasicTest_dnxcore50</RootNamespace>
<ProjectGuid>939fa5f7-16aa-4847-812b-6ebc3748a86d</ProjectGuid>
<RootNamespace>BasicTest</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
......
......@@ -14,7 +14,7 @@ class Program
{
static void Main(string[] args)
{
int AsyncOpsQty = 10000;
int AsyncOpsQty = 500000;
if(args.Length == 1)
{
int tmp;
......@@ -68,6 +68,5 @@ protected static string Me([CallerMemberName] string caller = null)
{
return caller;
}
}
}
{
"version": "1.0.0-*",
"description": "StackExchange.Redis.BasicTest dnxcore50",
"description": "StackExchange.Redis.BasicTest .NET Core",
"buildOptions": {
"compile": {
"include": [
"../BasicTest/Program.cs"
]
}
"emitEntryPoint": true
},
"dependencies": {
"StackExchange.Redis": {
......@@ -14,17 +10,20 @@
"target": "project"
}
},
"commands": {
"run": "BasicTest_dnxcore50"
"runtimes": {
"win7-x64": {}
},
"frameworks": {
"netcoreapp1.0": {
"buildOptions": {
"define": [ "CORE_CLR" ]
},
"imports": [ "dnxcore50" ],
"dependencies": {
"System.Console": "4.0.0-rc2-24027"
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
},
"System.Console": "4.0.0"
}
}
}
......
Pipelines and Multiplexers
===
Latency sucks. Modern computers can churn data at an alarming rate, and high speed networking (often with multiple parallel links between important servers) provides enormous bandwidth, but... that damned latency means that computers spend an awful lot of time *waiting for data* (one of the several reasons that continuation-based programming is becoming increasingly popular. Let's consider some regular procedural code:
Latency sucks. Modern computers can churn data at an alarming rate, and high speed networking (often with multiple parallel links between important servers) provides enormous bandwidth, but... that damned latency means that computers spend an awful lot of time *waiting for data* and that is one of the several reasons that continuation-based programming is becoming increasingly popular. Let's consider some regular procedural code:
```C#
string a = db.StringGet("a");
......@@ -97,7 +97,7 @@ Concurrency
It should be noted that the pipeline / multiplexer / future-value approach also plays very nicely with continuation-based asynchronous code; for example you could write:
```C#
string value = await db.StringGet(key);
string value = await db.StringGetAsync(key);
if (value == null) {
value = await ComputeValueFromDatabase(...);
db.StringSet(key, value, flags: CommandFlags.FireAndForget);
......
......@@ -41,7 +41,7 @@ public void ExecuteMassiveDelete()
var originallyTask = conn.SetLengthAsync(todoKey);
int keepChecking = 1;
Task last = null;
while (Thread.VolatileRead(ref keepChecking) == 1)
while (Volatile.Read(ref keepChecking) == 1)
{
throttle.Wait(); // acquire
conn.SetPopAsync(todoKey).ContinueWith(task =>
......@@ -51,7 +51,7 @@ public void ExecuteMassiveDelete()
{
if ((string)task.Result == null)
{
Thread.VolatileWrite(ref keepChecking, 0);
Volatile.Write(ref keepChecking, 0);
}
else
{
......
{
"runtimes": { "win": {} },
"frameworks": {
"net45": {
"dependencies": {
"NUnit": "3.0.0"
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>0fa2f7c5-1d36-40c4-82d1-93dbf43765d7</ProjectGuid>
<RootNamespace>MigratedBookSleeveTestSuite</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
......@@ -28,6 +28,7 @@ static void Main()
}
static void Main2()
{
#if !CORE_CLR
// why is this here? because some dumbass forgot to install a decent test-runner before going to the airport
var epicFail = new List<string>();
var testTypes = from type in typeof(Program).Assembly.GetTypes()
......@@ -163,6 +164,7 @@ where Attribute.IsDefined(method, typeof(TestAttribute))
// BookSleeve.RedisConnectionBase.AllSyncCallbacks, BookSleeve.RedisConnectionBase.AllAsyncCallbacks);
//#endif
#endif
}
}
}
......
......@@ -247,21 +247,21 @@ public void TestSubscribeUnsubscribeAndSubscribeAgain()
sub.WaitAll(t1, t2);
pub.Publish("abc", "");
AllowReasonableTimeToPublishAndProcess();
Assert.AreEqual(1, Thread.VolatileRead(ref x));
Assert.AreEqual(1, Thread.VolatileRead(ref y));
Assert.AreEqual(1, Volatile.Read(ref x));
Assert.AreEqual(1, Volatile.Read(ref y));
t1 = sub.UnsubscribeAsync("abc", null);
t2 = sub.UnsubscribeAsync("ab*", null);
sub.WaitAll(t1, t2);
pub.Publish("abc", "");
Assert.AreEqual(1, Thread.VolatileRead(ref x));
Assert.AreEqual(1, Thread.VolatileRead(ref y));
Assert.AreEqual(1, Volatile.Read(ref x));
Assert.AreEqual(1, Volatile.Read(ref y));
t1 = sub.SubscribeAsync("abc", delegate { Interlocked.Increment(ref x); });
t2 = sub.SubscribeAsync("ab*", delegate { Interlocked.Increment(ref y); });
sub.WaitAll(t1, t2);
pub.Publish("abc", "");
AllowReasonableTimeToPublishAndProcess();
Assert.AreEqual(2, Thread.VolatileRead(ref x));
Assert.AreEqual(2, Thread.VolatileRead(ref y));
Assert.AreEqual(2, Volatile.Read(ref x));
Assert.AreEqual(2, Volatile.Read(ref y));
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.0.0" targetFramework="net45" />
</packages>
\ No newline at end of file
{
"version": "1.0.0-*",
"description": "MigratedBookSleeveTestSuite",
"dependencies": {
"StackExchange.Redis": {
"version": "1.1.*",
"target": "project"
},
"nunit": "3.4.1"
},
"testRunner": "nunit",
"frameworks": {
"net45": {
},
"netcoreapp1.0": {
"imports": [
"portable-net45+win8"
],
"buildOptions": {
"define": [ "PLAT_SAFE_CONTINUATIONS", "CORE_CLR" ]
},
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
},
"System.Console": "4.0.0",
"System.Diagnostics.Debug": "4.0.11",
"System.Diagnostics.TraceSource": "4.0.0",
"System.Linq.Expressions": "4.1.0",
"System.Reflection.Extensions": "4.0.1",
"System.Runtime.InteropServices": "4.1.0",
"System.Threading.Tasks.Parallel": "4.0.1",
"Microsoft.CSharp": "4.0.1",
"dotnet-test-nunit": "3.4.0-beta-1"
}
}
}
}
......@@ -238,7 +238,7 @@ void Connect()
socket.Connect(Host, Port);
if (!socket.Connected)
{
socket.Close();
socket.Dispose();
socket = null;
return;
}
......@@ -272,7 +272,7 @@ bool SendDataCommand(byte[] data, string cmd, params object[] args)
catch (SocketException)
{
// timeout;
socket.Close();
socket.Dispose();
socket = null;
return false;
......@@ -297,7 +297,7 @@ bool SendCommand(string cmd, params object[] args)
catch (SocketException)
{
// timeout;
socket.Close();
socket.Dispose();
socket = null;
return false;
......@@ -842,7 +842,7 @@ protected virtual void Dispose(bool disposing)
if (disposing)
{
SendCommand("QUIT\r\n");
socket.Close();
socket.Dispose();
socket = null;
}
}
......
ea828c6074663c8bd4e705d3e3024d9d1721ef3b 127.0.0.1:7001 master - 0 1467584830754 2 connected 5461-10922
5ffbeb7f7872923ee0ed0913aedfe806265f5090 127.0.0.1:7003 slave 780813af558af81518e58e495d63b6e248e80adf 0 1467584830349 4 connected
780813af558af81518e58e495d63b6e248e80adf 127.0.0.1:7000 myself,master - 0 0 1 connected 0-5460
eaf2fc952dad107ffa28c0f436f73c3d52112276 127.0.0.1:7004 slave ea828c6074663c8bd4e705d3e3024d9d1721ef3b 0 1467584830854 5 connected
b1dc6b4fd60ffcff552d669b3294f6991ccb2b68 127.0.0.1:7005 slave 17f2a81c7fc22283ef93bf118cedb193a1122399 0 1467584829346 6 connected
17f2a81c7fc22283ef93bf118cedb193a1122399 127.0.0.1:7002 master - 0 1467584830754 3 connected 10923-16383
vars currentEpoch 6 lastVoteEpoch 0
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes
\ No newline at end of file
eaf2fc952dad107ffa28c0f436f73c3d52112276 127.0.0.1:7004 slave ea828c6074663c8bd4e705d3e3024d9d1721ef3b 0 1467584830397 5 connected
b1dc6b4fd60ffcff552d669b3294f6991ccb2b68 127.0.0.1:7005 slave 17f2a81c7fc22283ef93bf118cedb193a1122399 0 1467584829393 6 connected
17f2a81c7fc22283ef93bf118cedb193a1122399 127.0.0.1:7002 master - 0 1467584829092 3 connected 10923-16383
780813af558af81518e58e495d63b6e248e80adf 127.0.0.1:7000 master - 0 1467584829895 1 connected 0-5460
5ffbeb7f7872923ee0ed0913aedfe806265f5090 127.0.0.1:7003 slave 780813af558af81518e58e495d63b6e248e80adf 0 1467584831402 4 connected
ea828c6074663c8bd4e705d3e3024d9d1721ef3b 127.0.0.1:7001 myself,master - 0 0 2 connected 5461-10922
vars currentEpoch 6 lastVoteEpoch 0
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes
\ No newline at end of file
ea828c6074663c8bd4e705d3e3024d9d1721ef3b 127.0.0.1:7001 master - 0 1467584829405 2 connected 5461-10922
5ffbeb7f7872923ee0ed0913aedfe806265f5090 127.0.0.1:7003 slave 780813af558af81518e58e495d63b6e248e80adf 0 1467584831415 4 connected
b1dc6b4fd60ffcff552d669b3294f6991ccb2b68 127.0.0.1:7005 slave 17f2a81c7fc22283ef93bf118cedb193a1122399 0 1467584831615 6 connected
eaf2fc952dad107ffa28c0f436f73c3d52112276 127.0.0.1:7004 slave ea828c6074663c8bd4e705d3e3024d9d1721ef3b 0 1467584830408 5 connected
780813af558af81518e58e495d63b6e248e80adf 127.0.0.1:7000 master - 0 1467584830914 1 connected 0-5460
17f2a81c7fc22283ef93bf118cedb193a1122399 127.0.0.1:7002 myself,master - 0 0 3 connected 10923-16383
vars currentEpoch 6 lastVoteEpoch 0
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes
\ No newline at end of file
ea828c6074663c8bd4e705d3e3024d9d1721ef3b 127.0.0.1:7001 master - 0 1467584829099 2 connected 5461-10922
b1dc6b4fd60ffcff552d669b3294f6991ccb2b68 127.0.0.1:7005 slave 17f2a81c7fc22283ef93bf118cedb193a1122399 0 1467584829099 6 connected
eaf2fc952dad107ffa28c0f436f73c3d52112276 127.0.0.1:7004 slave ea828c6074663c8bd4e705d3e3024d9d1721ef3b 0 1467584830405 5 connected
17f2a81c7fc22283ef93bf118cedb193a1122399 127.0.0.1:7002 master - 0 1467584829399 3 connected 10923-16383
5ffbeb7f7872923ee0ed0913aedfe806265f5090 127.0.0.1:7003 myself,slave 780813af558af81518e58e495d63b6e248e80adf 0 0 4 connected
780813af558af81518e58e495d63b6e248e80adf 127.0.0.1:7000 master - 0 1467584831436 1 connected 0-5460
vars currentEpoch 6 lastVoteEpoch 0
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes
\ No newline at end of file
17f2a81c7fc22283ef93bf118cedb193a1122399 127.0.0.1:7002 master - 0 1467584828911 3 connected 10923-16383
5ffbeb7f7872923ee0ed0913aedfe806265f5090 127.0.0.1:7003 slave 780813af558af81518e58e495d63b6e248e80adf 0 1467584829103 4 connected
780813af558af81518e58e495d63b6e248e80adf 127.0.0.1:7000 master - 0 1467584829407 1 connected 0-5460
ea828c6074663c8bd4e705d3e3024d9d1721ef3b 127.0.0.1:7001 master - 0 1467584830411 2 connected 5461-10922
b1dc6b4fd60ffcff552d669b3294f6991ccb2b68 127.0.0.1:7005 slave 17f2a81c7fc22283ef93bf118cedb193a1122399 0 1467584829207 6 connected
eaf2fc952dad107ffa28c0f436f73c3d52112276 127.0.0.1:7004 myself,slave ea828c6074663c8bd4e705d3e3024d9d1721ef3b 0 0 5 connected
vars currentEpoch 6 lastVoteEpoch 0
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes
\ No newline at end of file
eaf2fc952dad107ffa28c0f436f73c3d52112276 127.0.0.1:7004 slave ea828c6074663c8bd4e705d3e3024d9d1721ef3b 0 1467584831428 5 connected
5ffbeb7f7872923ee0ed0913aedfe806265f5090 127.0.0.1:7003 slave 780813af558af81518e58e495d63b6e248e80adf 0 1467584831528 4 connected
780813af558af81518e58e495d63b6e248e80adf 127.0.0.1:7000 master - 0 1467584830927 1 connected 0-5460
ea828c6074663c8bd4e705d3e3024d9d1721ef3b 127.0.0.1:7001 master - 0 1467584830407 2 connected 5461-10922
b1dc6b4fd60ffcff552d669b3294f6991ccb2b68 127.0.0.1:7005 myself,slave 17f2a81c7fc22283ef93bf118cedb193a1122399 0 0 6 connected
17f2a81c7fc22283ef93bf118cedb193a1122399 127.0.0.1:7002 master - 0 1467584829400 3 connected 10923-16383
vars currentEpoch 6 lastVoteEpoch 0
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes
\ No newline at end of file
port 6379
dbfilename master.rdb
databases 2000
maxheap 6gb
maxmemory 6gb
save ""
\ No newline at end of file
@..\packages\Redis-64.2.8.19\redis-cli.exe -h cluster -p 7000
@..\packages\Redis-64.3.0.503\redis-cli.exe -h 127.0.0.1 -p 7000
@..\packages\Redis-64.2.8.19\redis-cli.exe -h cluster -p 7001
@..\packages\Redis-64.3.0.503\redis-cli.exe -h 127.0.0.1 -p 7001
@..\packages\Redis-64.2.8.19\redis-cli.exe -h cluster -p 7002
@..\packages\Redis-64.3.0.503\redis-cli.exe -h 127.0.0.1 -p 7002
@..\packages\Redis-64.2.8.19\redis-cli.exe -h cluster -p 7003
@..\packages\Redis-64.3.0.503\redis-cli.exe -h 127.0.0.1 -p 7003
@..\packages\Redis-64.2.8.19\redis-cli.exe -h cluster -p 7004
@..\packages\Redis-64.3.0.503\redis-cli.exe -h 127.0.0.1 -p 7004
@..\packages\Redis-64.2.8.19\redis-cli.exe -h cluster -p 7005
@..\packages\Redis-64.3.0.503\redis-cli.exe -h 127.0.0.1 -p 7005
@..\packages\Redis-64.2.8.19\redis-cli.exe -p 6379
@..\packages\Redis-64.3.0.503\redis-cli.exe -p 6379
@..\packages\Redis-64.2.8.19\redis-cli.exe -p 6381
@..\packages\Redis-64.3.0.503\redis-cli.exe -p 6381
@..\packages\Redis-64.2.8.19\redis-cli.exe -p 6380
@..\packages\Redis-64.3.0.503\redis-cli.exe -p 6380
@start ..\packages\Redis-64.2.8.19\redis-server.exe master.conf
@start ..\packages\Redis-64.2.8.19\redis-server.exe slave.conf
@start ..\packages\Redis-64.2.8.19\redis-server.exe secure.conf
@start ..\packages\Redis-64.3.0.503\redis-server.exe master.conf
@start ..\packages\Redis-64.3.0.503\redis-server.exe slave.conf
@start ..\packages\Redis-64.3.0.503\redis-server.exe secure.conf
@echo off
pushd Cluster\7000
@start /min ..\..\..\packages\Redis-64.3.0.503\redis-server.exe redis.conf --port 7000
popd
pushd Cluster\7001
@start /min ..\..\..\packages\Redis-64.3.0.503\redis-server.exe redis.conf --port 7001
popd
pushd Cluster\7002
@start /min ..\..\..\packages\Redis-64.3.0.503\redis-server.exe redis.conf --port 7002
popd
pushd Cluster\7003
@start /min ..\..\..\packages\Redis-64.3.0.503\redis-server.exe redis.conf --port 7003
popd
pushd Cluster\7004
@start /min ..\..\..\packages\Redis-64.3.0.503\redis-server.exe redis.conf --port 7004
popd
pushd Cluster\7005
@start /min ..\..\..\packages\Redis-64.3.0.503\redis-server.exe redis.conf --port 7005
popd
\ No newline at end of file
@..\packages\Redis-64.2.8.19\redis-server.exe master.conf
@..\packages\Redis-64.3.0.503\redis-server.exe master.conf
@..\packages\Redis-64.2.8.19\redis-server.exe secure.conf
@..\packages\Redis-64.3.0.503\redis-server.exe secure.conf
@..\packages\Redis-64.2.8.19\redis-server.exe slave.conf
@..\packages\Redis-64.3.0.503\redis-server.exe slave.conf
This diff is collapsed.
......@@ -2,5 +2,5 @@ port 6381
requirepass changeme
dbfilename secure.rdb
databases 2000
maxheap 512mb
maxmemory 512mb
save ""
\ No newline at end of file
......@@ -2,5 +2,5 @@ port 6380
slaveof 127.0.0.1 6379
dbfilename slave.rdb
databases 2000
maxheap 2gb
maxmemory 2gb
save ""
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StackExchange.Redis", "StackExchange.Redis\StackExchange.Redis.xproj", "{EF84877F-59BE-41BE-9013-E765AF0BB72E}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StackExchange.Redis.StrongName", "StackExchange.Redis.StrongName\StackExchange.Redis.StrongName.xproj", "{46754D2A-AC16-4686-B113-3DB08ACF4269}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StackExchange.Redis.Tests", "StackExchange.Redis.Tests\StackExchange.Redis.Tests.xproj", "{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3AD17044-6BFF-4750-9AC2-2CA466375F2A}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
NuGet.Config = NuGet.Config
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Redis Configs", "Redis Configs", "{96E891CD-2ED7-4293-A7AB-4C6F5D8D2B05}"
ProjectSection(SolutionItems) = preProject
Redis Configs\master.conf = Redis Configs\master.conf
Redis Configs\redis-cli 7000.cmd = Redis Configs\redis-cli 7000.cmd
Redis Configs\redis-cli 7001.cmd = Redis Configs\redis-cli 7001.cmd
Redis Configs\redis-cli 7002.cmd = Redis Configs\redis-cli 7002.cmd
Redis Configs\redis-cli 7003.cmd = Redis Configs\redis-cli 7003.cmd
Redis Configs\redis-cli 7004.cmd = Redis Configs\redis-cli 7004.cmd
Redis Configs\redis-cli 7005.cmd = Redis Configs\redis-cli 7005.cmd
Redis Configs\redis-cli master.cmd = Redis Configs\redis-cli master.cmd
Redis Configs\redis-cli secure.cmd = Redis Configs\redis-cli secure.cmd
Redis Configs\redis-cli slave.cmd = Redis Configs\redis-cli slave.cmd
Redis Configs\redis-server all local.cmd = Redis Configs\redis-server all local.cmd
Redis Configs\redis-server master.cmd = Redis Configs\redis-server master.cmd
Redis Configs\redis-server secure.cmd = Redis Configs\redis-server secure.cmd
Redis Configs\redis-server slave.cmd = Redis Configs\redis-server slave.cmd
Redis Configs\secure.conf = Redis Configs\secure.conf
Redis Configs\slave.conf = Redis Configs\slave.conf
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BasicTest", "BasicTest\BasicTest.xproj", "{939FA5F7-16AA-4847-812B-6EBC3748A86D}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MigratedBookSleeveTestSuite", "MigratedBookSleeveTestSuite\MigratedBookSleeveTestSuite.xproj", "{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Docs", "Docs\Docs.csproj", "{7909952C-0F38-4E62-A7BA-1A77E1452FDA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Log Output|Any CPU = Log Output|Any CPU
Mono|Any CPU = Mono|Any CPU
Release|Any CPU = Release|Any CPU
Verbose|Any CPU = Verbose|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Log Output|Any CPU.ActiveCfg = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Log Output|Any CPU.Build.0 = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Mono|Any CPU.ActiveCfg = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Mono|Any CPU.Build.0 = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Release|Any CPU.Build.0 = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Verbose|Any CPU.Build.0 = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Log Output|Any CPU.ActiveCfg = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Log Output|Any CPU.Build.0 = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Mono|Any CPU.ActiveCfg = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Mono|Any CPU.Build.0 = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Release|Any CPU.Build.0 = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Verbose|Any CPU.Build.0 = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Log Output|Any CPU.ActiveCfg = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Log Output|Any CPU.Build.0 = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Mono|Any CPU.ActiveCfg = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Mono|Any CPU.Build.0 = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Release|Any CPU.Build.0 = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Verbose|Any CPU.Build.0 = Release|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Log Output|Any CPU.ActiveCfg = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Log Output|Any CPU.Build.0 = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Mono|Any CPU.ActiveCfg = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Mono|Any CPU.Build.0 = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Release|Any CPU.Build.0 = Release|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Verbose|Any CPU.ActiveCfg = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Verbose|Any CPU.Build.0 = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Log Output|Any CPU.ActiveCfg = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Log Output|Any CPU.Build.0 = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Mono|Any CPU.ActiveCfg = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Mono|Any CPU.Build.0 = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Release|Any CPU.Build.0 = Release|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Verbose|Any CPU.ActiveCfg = Debug|Any CPU
{0FA2F7C5-1D36-40C4-82D1-93DBF43765D7}.Verbose|Any CPU.Build.0 = Debug|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Log Output|Any CPU.ActiveCfg = Mono|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Log Output|Any CPU.Build.0 = Mono|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Mono|Any CPU.ActiveCfg = Mono|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Mono|Any CPU.Build.0 = Mono|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Release|Any CPU.Build.0 = Release|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Verbose|Any CPU.ActiveCfg = Mono|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Verbose|Any CPU.Build.0 = Mono|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
......@@ -13,7 +13,7 @@
}
},
"title": "StackExchange.Redis.StrongName",
"version": "1.1.604-*",
"version": "1.1.608-*",
"description": "High performance Redis client, incorporating both synchronous and asynchronous usage.",
"authors": [ "Stack Exchange inc., marc.gravell" ],
"copyright": "Stack Exchange inc. 2014-",
......@@ -43,7 +43,7 @@
"Microsoft.Bcl.Async": "1.0.168"
},
"buildOptions": {
"define": [ "FEATURE_SERIALIZATION" ]
"define": [ "FEATURE_SERIALIZATION", "FEATURE_SOCKET_MODE_POLL" ]
}
},
"net45": {
......@@ -51,34 +51,44 @@
"System.IO.Compression": "4.0.0.0"
},
"buildOptions": {
"define": [ "FEATURE_SERIALIZATION" ]
"define": [ "FEATURE_SERIALIZATION", "FEATURE_SOCKET_MODE_POLL" ]
}
},
"net46": {
"frameworkAssemblies": {
"System.IO.Compression": "4.0.0.0"
},
"define": [ "FEATURE_SERIALIZATION", "PLAT_SAFE_CONTINUATIONS" ]
"buildOptions": {
"define": [ "FEATURE_SERIALIZATION", "FEATURE_SOCKET_MODE_POLL" ]
}
},
"netstandard1.5": {
"buildOptions": {
"define": [ "PLAT_SAFE_CONTINUATIONS", "CORE_CLR" ]
"define": [ "CORE_CLR" ]
},
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027",
"System.Collections.NonGeneric": "4.0.1-rc2-24027",
"System.IO.FileSystem": "4.0.1-rc2-24027",
"System.Net.NameResolution": "4.0.0-rc2-24027",
"System.Net.Security": "4.0.0-rc2-24027",
"System.Net.Sockets": "4.1.0-rc2-24027",
"System.Reflection.Emit": "4.0.1-rc2-24027",
"System.Reflection.Emit.Lightweight": "4.0.1-rc2-24027",
"System.Reflection.TypeExtensions": "4.1.0-rc2-24027",
"System.Security.Cryptography.Algorithms": "4.1.0-rc2-24027",
"System.Security.Cryptography.X509Certificates": "4.1.0-rc2-24027",
"System.Threading.Thread": "4.0.0-rc2-24027",
"System.Threading.ThreadPool": "4.0.10-rc2-24027",
"System.Threading.Timer": "4.0.1-rc2-24027"
"System.Collections": "4.0.11",
"System.Collections.Concurrent": "4.0.12",
"System.Collections.NonGeneric": "4.0.1",
"System.Diagnostics.Tools": "4.0.1",
"System.IO.Compression": "4.1.0",
"System.IO.FileSystem": "4.0.1",
"System.Linq": "4.1.0",
"System.Net.NameResolution": "4.0.0",
"System.Net.Security": "4.0.0",
"System.Net.Sockets": "4.1.0",
"System.Reflection.Emit": "4.0.1",
"System.Reflection.Emit.Lightweight": "4.0.1",
"System.Reflection.TypeExtensions": "4.1.0",
"System.Runtime.Extensions": "4.1.0",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0",
"System.Security.Cryptography.Algorithms": "4.2.0",
"System.Security.Cryptography.X509Certificates": "4.1.0",
"System.Text.RegularExpressions": "4.1.0",
"System.Threading": "4.0.11",
"System.Threading.Thread": "4.0.0",
"System.Threading.ThreadPool": "4.0.10",
"System.Threading.Timer": "4.0.1"
}
}
}
......
......@@ -13,17 +13,14 @@ namespace StackExchange.Redis.Tests
public class Cluster : TestBase
{
//private const string ClusterIp = "192.168.0.15"; // marc
private const string ClusterIp = "10.110.11.102"; // kmontrose
//private const string ClusterIp = "10.110.11.102"; // kmontrose
private const string ClusterIp = "127.0.0.1";
private const int ServerCount = 6, FirstPort = 7000;
protected override string GetConfiguration()
{
var server = ClusterIp;
#if !CORE_CLR
if (string.Equals(Environment.MachineName, "MARC-LAPTOP", StringComparison.InvariantCultureIgnoreCase))
#else
if (string.Equals(Environment.GetEnvironmentVariable("COMPUTERNAME"), "MARC-LAPTOP", StringComparison.OrdinalIgnoreCase))
#endif
if (string.Equals(Environment.MachineName, "MARC-LAPTOP", StringComparison.OrdinalIgnoreCase))
{
server = "192.168.56.101";
}
......
......@@ -86,7 +86,7 @@ public void SocketFailureError()
Assert.That(rde.FailureType, Is.EqualTo(ConnectionFailureType.SocketFailure));
}
}
#if DEBUG // needs AllowConnect, which is DEBUG only
[Test]
public void CheckFailureRecovered()
{
......@@ -117,7 +117,7 @@ public void CheckFailureRecovered()
ClearAmbientFailures();
}
}
#endif
[Test]
public void TryGetAzureRoleInstanceIdNoThrow()
{
......
......@@ -25,7 +25,7 @@ public void NullSnapshot()
var ex = ExceptionFactory.NoConnectionAvailable(true, new RedisCommand(), null, null, null);
Assert.Null(ex.InnerException);
}
#if DEBUG // needs debug connection features
[Test]
public void MultipleEndpointsThrowAggregateException()
{
......@@ -108,6 +108,6 @@ public void ServerTakesPrecendenceOverSnapshot()
}
}
#endif
}
}
#if NUNITLITE
#if NUNITLITE && !CORE_CLR
using System;
using System.Reflection;
using NUnit.Common;
......
......@@ -38,15 +38,6 @@ public void ConnectToAzure(int? port, bool ssl)
}
}
private static void GetAzureCredentials(out string name, out string password)
{
var lines = File.ReadAllLines(@"d:\dev\azure.txt");
if (lines == null || lines.Length != 2)
Assert.Inconclusive("azure credentials missing");
name = lines[0];
password = lines[1];
}
[Test]
[TestCase(false, false)]
[TestCase(true, false)]
......
......@@ -14,5 +14,8 @@
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
......@@ -168,7 +168,7 @@ protected IServer GetServer(ConnectionMultiplexer muxer)
bool checkConnect = true, bool pause = true, string failMessage = null,
string channelPrefix = null, bool useSharedSocketManager = true, Proxy? proxy = null)
{
if(pause) Thread.Sleep(500); // get a lot of glitches when hammering new socket creations etc; pace it out a bit
if(pause) Thread.Sleep(250); // get a lot of glitches when hammering new socket creations etc; pace it out a bit
string configuration = GetConfiguration();
var config = ConfigurationOptions.Parse(configuration);
if (disabledCommands != null && disabledCommands.Length != 0)
......
......@@ -10,7 +10,7 @@ public class VPNTest : TestBase
[Test]
[MaxTime(100000)]
[TestCase("or-devredis01.ds.stackexchange.com:6379")]
[TestCase("co-devredis01.ds.stackexchange.com:6379")]
public void Execute(string config)
{
for (int i = 0; i < 50; i++)
......
......@@ -5,31 +5,32 @@
"StackExchange.Redis": {
"version": "1.1.*",
"target": "project"
}
},
"commands": {
"run": "StackExchange.Redis.Tests"
},
"buildOptions": {
"define": [ "NUNITLITE" ],
"emitEntryPoint": true
},
"runtimes": {
"win81-x64": {}
"redis-64": "3.0.503",
"nunit": "3.4.1",
"dotnet-test-nunit": "3.4.0-beta-1"
},
"testRunner": "nunit",
"frameworks": {
"netcoreapp1.0": {
"imports": [ "dnxcore50" ],
"imports": [
"portable-net45+win8"
],
"buildOptions": {
"define": [ "PLAT_SAFE_CONTINUATIONS", "CORE_CLR" ]
"define": [ "CORE_CLR" ]
},
"dependencies": {
"System.Console": "4.0.0-rc2-24027",
"System.Linq.Expressions": "4.0.11-rc2-24027",
"System.Reflection.Extensions": "4.0.1-rc2-24027",
"System.Threading.Tasks.Parallel": "4.0.1-rc2-24027",
"Microsoft.CSharp": "4.0.1-rc2-24027",
"nunitlite": "3.2.1"
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
},
"System.Console": "4.0.0",
"System.Diagnostics.Debug": "4.0.11",
"System.Linq.Expressions": "4.1.0",
"System.Reflection.Extensions": "4.0.1",
"System.Runtime.InteropServices": "4.1.0",
"System.Threading.Tasks.Parallel": "4.0.1",
"Microsoft.CSharp": "4.0.1"
}
}
}
......
......@@ -77,7 +77,7 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\StackExchange.Redis.Tests\**\*.cs"/>
<Compile Include="..\StackExchange.Redis.Tests\**\*.cs" Exclude="..\StackExchange.Redis.Tests\obj\**\*.cs"/>
</ItemGroup>
<ItemGroup>
<None Include="packages.config">
......

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BasicTest_dnxcore50", "BasicTest_dnxcore50\BasicTest_dnxcore50.xproj", "{9D83BABA-A92E-495F-BF63-DEB4F6B09355}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StackExchange.Redis", "StackExchange.Redis\StackExchange.Redis.xproj", "{EF84877F-59BE-41BE-9013-E765AF0BB72E}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StackExchange.Redis.StrongName", "StackExchange.Redis.StrongName\StackExchange.Redis.StrongName.xproj", "{46754D2A-AC16-4686-B113-3DB08ACF4269}"
......@@ -13,19 +11,18 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StackExchange.Redis.Tests",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3AD17044-6BFF-4750-9AC2-2CA466375F2A}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
NuGet.Config = NuGet.Config
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BasicTest", "BasicTest\BasicTest.xproj", "{939FA5F7-16AA-4847-812B-6EBC3748A86D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Release|Any CPU.Build.0 = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Release|Any CPU.ActiveCfg = Release|Any CPU
......@@ -38,6 +35,10 @@ Global
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Release|Any CPU.Build.0 = Release|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{939FA5F7-16AA-4847-812B-6EBC3748A86D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -233,7 +233,7 @@ public CommandMap CommandMap
public string Password { get { return password; } set { password = value; } }
/// <summary>
/// Indicates whether admin operations should be allowed
/// Type of proxy to use (if any); for example Proxy.Twemproxy
/// </summary>
public Proxy Proxy { get { return proxy.GetValueOrDefault(); } set { proxy = value; } }
......
......@@ -905,7 +905,11 @@ internal ServerEndPoint GetServerEndPoint(EndPoint endpoint)
if (isDisposed) throw new ObjectDisposedException(ToString());
server = new ServerEndPoint(this, endpoint, null);
// ^^ this could indirectly cause servers to become changes, so treble-check!
if (!servers.ContainsKey(endpoint))
{
servers.Add(endpoint, server);
}
var newSnapshot = serverSnapshot;
Array.Resize(ref newSnapshot, newSnapshot.Length + 1);
......@@ -1222,11 +1226,19 @@ internal async Task<bool> ReconfigureAsync(bool first, bool reconfigureAll, Text
serverSnapshot = new ServerEndPoint[configuration.EndPoints.Count];
foreach (var endpoint in configuration.EndPoints)
{
var server = new ServerEndPoint(this, endpoint, log);
serverSnapshot[index++] = server;
var server = (ServerEndPoint)servers[endpoint];
if (server == null)
{
server = new ServerEndPoint(this, endpoint, log);
// ^^ this could indirectly cause servers to become changes, so treble-check!
if (!servers.ContainsKey(endpoint))
{
servers.Add(endpoint, server);
}
}
serverSnapshot[index++] = server;
}
}
foreach (var server in serverSnapshot)
{
server.Activate(ConnectionType.Interactive, log);
......
......@@ -89,7 +89,7 @@ public interface IProfiledCommand
TimeSpan ResponseToCompletion { get; }
/// <summary>
/// How long it took this redis command to be processed, from creation to deserializing the final resposne.
/// How long it took this redis command to be processed, from creation to deserializing the final response.
///
/// Note that this TimeSpan *does not* include time spent awaiting a Task in consumer code.
/// </summary>
......
......@@ -175,6 +175,17 @@ public partial interface IServer : IRedis
/// <remarks>http://redis.io/commands/dbsize</remarks>
Task<long> DatabaseSizeAsync(int database = 0, CommandFlags flags = CommandFlags.None);
/// <summary>
/// Return the same message passed in
/// </summary>
/// <remarks>http://redis.io/commands/echo</remarks>
RedisValue Echo(RedisValue message, CommandFlags flags = CommandFlags.None);
/// <summary>
/// Return the same message passed in
/// </summary>
/// <remarks>http://redis.io/commands/echo</remarks>
Task<RedisValue> EchoAsync(RedisValue message, CommandFlags flags = CommandFlags.None);
/// <summary>
/// Delete all the keys of all databases on the server.
......
using System.Text.RegularExpressions;
#if CORE_CLR
using System;
#endif
namespace StackExchange.Redis
{
/// <summary>
/// Credits to Sam Harwell https://github.com/dotnet/corefx/issues/340#issuecomment-120749951
/// </summary>
internal static class InternalRegexCompiledOption
{
static InternalRegexCompiledOption()
{
#if CORE_CLR
RegexOptions tmp;
if (!Enum.TryParse("Compiled", out tmp))
tmp = RegexOptions.None;
Default = tmp;
#else
Default = RegexOptions.Compiled;
#endif
}
/// <summary>
/// Gets the default <see cref="RegexOptions"/> to use.
/// <see cref="System.Text.RegularExpressions.RegexOptions.Compiled"/> option isn't available yet for dnxcore50.
/// This returns <see cref="System.Text.RegularExpressions.RegexOptions.Compiled"/> if it is supported;
/// <see cref="System.Text.RegularExpressions.RegexOptions.None"/> otherwise.
/// </summary>
public static RegexOptions Default { get; }
}
}
......@@ -32,6 +32,10 @@ private static Action<Task<int>> EndReadFactory(PhysicalConnection physical)
{
return result =>
{ // can't capture AsyncState on SocketRead, so we'll do it once per physical instead
if (result.IsFaulted)
{
GC.KeepAlive(result.Exception);
}
try
{
physical.Multiplexer.Trace("Completed asynchronously: processing in callback", physical.physicalName);
......@@ -690,7 +694,7 @@ void BeginReading()
Multiplexer.Trace("Beginning async read...", physicalName);
#if CORE_CLR
var result = netStream.ReadAsync(ioBuffer, ioBufferBytes, space);
switch(result.Status)
switch (result.Status)
{
case TaskStatus.RanToCompletion:
case TaskStatus.Faulted:
......
......@@ -206,6 +206,17 @@ public Task<long> DatabaseSizeAsync(int database = 0, CommandFlags flags = Comma
return ExecuteAsync(msg, ResultProcessor.Int64);
}
public RedisValue Echo(RedisValue message, CommandFlags flags)
{
var msg = Message.Create(-1, flags, RedisCommand.ECHO, message);
return ExecuteSync(msg, ResultProcessor.RedisValue);
}
public Task<RedisValue> EchoAsync(RedisValue message, CommandFlags flags)
{
var msg = Message.Create(-1, flags, RedisCommand.ECHO, message);
return ExecuteAsync(msg, ResultProcessor.RedisValue);
}
public void FlushAllDatabases(CommandFlags flags = CommandFlags.None)
{
var msg = Message.Create(-1, flags, RedisCommand.FLUSHALL);
......
......@@ -356,7 +356,7 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
internal sealed class ScriptLoadProcessor : ResultProcessor<byte[]>
{
static readonly Regex sha1 = new Regex("^[0-9a-f]{40}$", InternalRegexCompiledOption.Default | RegexOptions.IgnoreCase);
static readonly Regex sha1 = new Regex("^[0-9a-f]{40}$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
internal static bool IsSHA1(string script)
{
......
......@@ -23,7 +23,7 @@ public ScriptParameters(RedisKey[] keys, RedisValue[] args)
}
}
static readonly Regex ParameterExtractor = new Regex(@"@(?<paramName> ([a-z]|_) ([a-z]|_|\d)*)", InternalRegexCompiledOption.Default | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
static readonly Regex ParameterExtractor = new Regex(@"@(?<paramName> ([a-z]|_) ([a-z]|_|\d)*)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
static string[] ExtractParameters(string script)
{
var ps = ParameterExtractor.Matches(script);
......
......@@ -25,7 +25,7 @@ internal sealed partial class ServerEndPoint : IDisposable
{
internal volatile ServerEndPoint Master;
internal volatile ServerEndPoint[] Slaves = NoSlaves;
private static readonly Regex nameSanitizer = new Regex("[^!-~]", InternalRegexCompiledOption.Default);
private static readonly Regex nameSanitizer = new Regex("[^!-~]", RegexOptions.Compiled);
private static readonly ServerEndPoint[] NoSlaves = new ServerEndPoint[0];
private readonly EndPoint endpoint;
......
......@@ -69,17 +69,13 @@ static TaskSource()
tcs.SetResult(0);
if (!expectTrue || expectFalse)
{
Debug.WriteLine("IsSyncSafe reported incorrectly!");
Trace.WriteLine("IsSyncSafe reported incorrectly!");
// revert to not trusting /them
IsSyncSafe = null;
}
}
}
catch (Exception ex)
catch (Exception)
{
Debug.WriteLine(ex.Message);
Trace.WriteLine(ex.Message);
IsSyncSafe = null;
}
if (IsSyncSafe == null)
......
......@@ -13,7 +13,7 @@
}
},
"title": "StackExchange.Redis",
"version": "1.1.604-*",
"version": "1.1.608-*",
"description": "High performance Redis client, incorporating both synchronous and asynchronous usage.",
"authors": [ "Stack Exchange inc., marc.gravell" ],
"copyright": "Stack Exchange inc. 2014-",
......@@ -33,38 +33,54 @@
"dependencies": {
"Microsoft.Bcl": "1.1.10",
"Microsoft.Bcl.Async": "1.0.168"
},
"buildOptions": {
"define": [ "FEATURE_SERIALIZATION", "FEATURE_SOCKET_MODE_POLL" ]
}
},
"net45": {
"frameworkAssemblies": {
"System.IO.Compression": "4.0.0.0"
},
"buildOptions": {
"define": [ "FEATURE_SERIALIZATION", "FEATURE_SOCKET_MODE_POLL" ]
}
},
"net46": {
"frameworkAssemblies": {
"System.IO.Compression": "4.0.0.0"
},
"define": [ "PLAT_SAFE_CONTINUATIONS" ]
"buildOptions": {
"define": [ "FEATURE_SERIALIZATION", "FEATURE_SOCKET_MODE_POLL" ]
}
},
"netstandard1.5": {
"buildOptions": {
"define": [ "PLAT_SAFE_CONTINUATIONS", "CORE_CLR" ]
"define": [ "CORE_CLR" ]
},
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027",
"System.Collections.NonGeneric": "4.0.1-rc2-24027",
"System.IO.FileSystem": "4.0.1-rc2-24027",
"System.Net.NameResolution": "4.0.0-rc2-24027",
"System.Net.Security": "4.0.0-rc2-24027",
"System.Net.Sockets": "4.1.0-rc2-24027",
"System.Reflection.Emit": "4.0.1-rc2-24027",
"System.Reflection.Emit.Lightweight": "4.0.1-rc2-24027",
"System.Reflection.TypeExtensions": "4.1.0-rc2-24027",
"System.Security.Cryptography.Algorithms": "4.1.0-rc2-24027",
"System.Security.Cryptography.X509Certificates": "4.1.0-rc2-24027",
"System.Threading.Thread": "4.0.0-rc2-24027",
"System.Threading.ThreadPool": "4.0.10-rc2-24027",
"System.Threading.Timer": "4.0.1-rc2-24027"
"System.Collections": "4.0.11",
"System.Collections.Concurrent": "4.0.12",
"System.Collections.NonGeneric": "4.0.1",
"System.Diagnostics.Tools": "4.0.1",
"System.IO.Compression": "4.1.0",
"System.IO.FileSystem": "4.0.1",
"System.Linq": "4.1.0",
"System.Net.NameResolution": "4.0.0",
"System.Net.Security": "4.0.0",
"System.Net.Sockets": "4.1.0",
"System.Reflection.Emit": "4.0.1",
"System.Reflection.Emit.Lightweight": "4.0.1",
"System.Reflection.TypeExtensions": "4.1.0",
"System.Runtime.Extensions": "4.1.0",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0",
"System.Security.Cryptography.Algorithms": "4.2.0",
"System.Security.Cryptography.X509Certificates": "4.1.0",
"System.Text.RegularExpressions": "4.1.0",
"System.Threading": "4.0.11",
"System.Threading.Thread": "4.0.0",
"System.Threading.ThreadPool": "4.0.10",
"System.Threading.Timer": "4.0.1"
}
}
}
......
......@@ -77,7 +77,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\StackExchange.Redis\**\*.cs"/>
<Compile Include="..\StackExchange.Redis\**\*.cs" Exclude="..\StackExchange.Redis\obj\**\*.cs"/>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
......
......@@ -74,7 +74,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\StackExchange.Redis\**\*.cs"/>
<Compile Include="..\StackExchange.Redis\**\*.cs" Exclude="..\StackExchange.Redis\obj\**\*.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
......
......@@ -79,7 +79,7 @@
<Reference Include="System.IO.Compression" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\StackExchange.Redis\**\*.cs"/>
<Compile Include="..\StackExchange.Redis\**\*.cs" Exclude="..\StackExchange.Redis\obj\**\*.cs"/>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
......
......@@ -73,7 +73,7 @@
<Reference Include="System.IO.Compression" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\StackExchange.Redis\**\*.cs"/>
<Compile Include="..\StackExchange.Redis\**\*.cs" Exclude="..\StackExchange.Redis\obj\**\*.cs"/>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
......
......@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin.snk\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET46 PLAT_SAFE_CONTINUATIONS STRONG_NAME FEATURE_SERIALIZATION FEATURE_SOCKET_MODE_POLL</DefineConstants>
<DefineConstants>TRACE;DEBUG;NET46 STRONG_NAME FEATURE_SERIALIZATION FEATURE_SOCKET_MODE_POLL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
......@@ -63,7 +63,7 @@
<Reference Include="System.IO.Compression" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\StackExchange.Redis\**\*.cs"/>
<Compile Include="..\StackExchange.Redis\**\*.cs" Exclude="..\StackExchange.Redis\obj\**\*.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
......
......@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET46 PLAT_SAFE_CONTINUATIONS FEATURE_SERIALIZATION;FEATURE_SOCKET_MODE_POLL</DefineConstants>
<DefineConstants>TRACE;DEBUG;NET46 FEATURE_SERIALIZATION;FEATURE_SOCKET_MODE_POLL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
......@@ -57,7 +57,7 @@
<Reference Include="System.IO.Compression" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\StackExchange.Redis\**\*.cs"/>
<Compile Include="..\StackExchange.Redis\**\*.cs" Exclude="..\StackExchange.Redis\obj\**\*.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
......
{
"sdk": {
"version": "1.0.0-preview1-002702"
"version": "1.0.0-preview2-003121"
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment