Commit baac1bc1 authored by Marc Gravell's avatar Marc Gravell

Merge branch 'master' of github.com:StackExchange/StackExchange.Redis into core-rtm

parents fafb8cac 5688bc11
...@@ -45,7 +45,7 @@ Given the above information, it's recommend to set the minimum configuration val ...@@ -45,7 +45,7 @@ Given the above information, it's recommend to set the minimum configuration val
How to configure this setting: How to configure this setting:
- In ASP.NET, use the ["minIoThreads" configuration setting](https://msdn.microsoft.com/en-us/library/vstudio/7w2sway1(v=vs.100).aspx) under the `<processModel>` configuration element in web.config. You should be able to set this programmatically (see below) from your Application_Start method in global.asax.cs. - In ASP.NET, use the ["minIoThreads" configuration setting](https://msdn.microsoft.com/en-us/library/vstudio/7w2sway1(v=vs.100).aspx) under the `<processModel>` configuration element in machine.config. If you are running inside of Azure WebSites, this setting is not exposed through the configuration options. You should be able to set this programmatically (see below) from your Application_Start method in global.asax.cs.
> **Important Note:** the value specified in this configuration element is a *per-core* setting. For example, if you have a 4 core machine and want your minIOThreads setting to be 200 at runtime, you would use `<processModel minIoThreads="50"/>`. > **Important Note:** the value specified in this configuration element is a *per-core* setting. For example, if you have a 4 core machine and want your minIOThreads setting to be 200 at runtime, you would use `<processModel minIoThreads="50"/>`.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<dependencies> <dependencies>
<group targetFramework="net40"> <group targetFramework="net40">
<dependency id="Microsoft.Bcl" version="1.1.9"/> <dependency id="Microsoft.Bcl" version="1.1.10"/>
<dependency id="Microsoft.Bcl.Async" version="1.0.168"/> <dependency id="Microsoft.Bcl.Async" version="1.0.168"/>
</group> </group>
<group targetFramework="net45"> <group targetFramework="net45">
......
...@@ -7,6 +7,14 @@ namespace StackExchange.Redis ...@@ -7,6 +7,14 @@ namespace StackExchange.Redis
/// </summary> /// </summary>
public abstract class RedisResult public abstract class RedisResult
{ {
/// <summary>
/// Create a new RedisResult.
/// </summary>
/// <returns></returns>
public static RedisResult Create(RedisValue value)
{
return new SingleRedisResult(value);
}
// internally, this is very similar to RawResult, except it is designed to be usable // internally, this is very similar to RawResult, except it is designed to be usable
// outside of the IO-processing pipeline: the buffers are standalone, etc // outside of the IO-processing pipeline: the buffers are standalone, etc
......
...@@ -185,7 +185,7 @@ public bool Remove(Action<RedisChannel, RedisValue> value) ...@@ -185,7 +185,7 @@ public bool Remove(Action<RedisChannel, RedisValue> value)
public Task SubscribeToServer(ConnectionMultiplexer multiplexer, RedisChannel channel, CommandFlags flags, object asyncState, bool internalCall) public Task SubscribeToServer(ConnectionMultiplexer multiplexer, RedisChannel channel, CommandFlags flags, object asyncState, bool internalCall)
{ {
var cmd = channel.IsPatternBased ? RedisCommand.PSUBSCRIBE : RedisCommand.SUBSCRIBE; var cmd = channel.IsPatternBased ? RedisCommand.PSUBSCRIBE : RedisCommand.SUBSCRIBE;
var selected = multiplexer.SelectServer(-1, cmd, CommandFlags.DemandMaster, default(RedisKey)); var selected = multiplexer.SelectServer(-1, cmd, flags, default(RedisKey));
if (selected == null || Interlocked.CompareExchange(ref owner, selected, null) != null) return null; if (selected == null || Interlocked.CompareExchange(ref owner, selected, null) != null) return null;
......
using System; using System;
#if CORE_CLR #if CORE_CLR
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
......
...@@ -141,6 +141,7 @@ public virtual bool SetResult(PhysicalConnection connection, Message message, Ra ...@@ -141,6 +141,7 @@ public virtual bool SetResult(PhysicalConnection connection, Message message, Ra
var server = bridge.ServerEndPoint; var server = bridge.ServerEndPoint;
bool log = !message.IsInternalCall; bool log = !message.IsInternalCall;
bool isMoved = result.AssertStarts(MOVED); bool isMoved = result.AssertStarts(MOVED);
string err = string.Empty;
if (isMoved || result.AssertStarts(ASK)) if (isMoved || result.AssertStarts(ASK))
{ {
message.SetResponseReceived(); message.SetResponseReceived();
...@@ -161,11 +162,19 @@ public virtual bool SetResult(PhysicalConnection connection, Message message, Ra ...@@ -161,11 +162,19 @@ public virtual bool SetResult(PhysicalConnection connection, Message message, Ra
connection.Multiplexer.Trace(message.Command + " re-issued to " + endpoint, isMoved ? "MOVED" : "ASK"); connection.Multiplexer.Trace(message.Command + " re-issued to " + endpoint, isMoved ? "MOVED" : "ASK");
return false; return false;
} }
else
{
err = string.Format("Endpoint {0} serving hashslot {1} is not reachable at this point of time. Please check connectTimeout value. If it is low, try increasing it to give the ConnectionMultiplexer a chance to recover from the network disconnect.", endpoint, hashSlot);
}
} }
} }
} }
string err = result.GetString(); if (string.IsNullOrWhiteSpace(err))
{
err = result.GetString();
}
if (log) if (log)
{ {
bridge.Multiplexer.OnErrorMessage(server.EndPoint, err); bridge.Multiplexer.OnErrorMessage(server.EndPoint, err);
......
...@@ -101,7 +101,8 @@ internal Exception LastException ...@@ -101,7 +101,8 @@ internal Exception LastException
//check if subscription endpoint has a better lastexception //check if subscription endpoint has a better lastexception
if (tmp2 != null && tmp2.LastException != null) if (tmp2 != null && tmp2.LastException != null)
{ {
if (!tmp2.LastException.Data["Redis-FailureType"].ToString().Equals(ConnectionFailureType.UnableToConnect.ToString())) var failureType = tmp2.LastException.Data["Redis-FailureType"];
if (failureType != null && !failureType.ToString().Equals(ConnectionFailureType.UnableToConnect.ToString()))
{ {
return tmp2.LastException; return tmp2.LastException;
} }
......
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