Commit 90236efc authored by Marc Gravell's avatar Marc Gravell

1.2.6: fix bug when targeting cluster on 4.0+

parent 15ec0573
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<VersionPrefix>1.2.5</VersionPrefix> <VersionPrefix>1.2.6</VersionPrefix>
<Copyright>2017 Stack Exchange, Inc.</Copyright> <Copyright>2017 Stack Exchange, Inc.</Copyright>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
......
...@@ -182,8 +182,8 @@ internal ClusterConfiguration(ServerSelectionStrategy serverSelectionStrategy, s ...@@ -182,8 +182,8 @@ internal ClusterConfiguration(ServerSelectionStrategy serverSelectionStrategy, s
if (string.IsNullOrWhiteSpace(line)) continue; if (string.IsNullOrWhiteSpace(line)) continue;
var node = new ClusterNode(this, line, origin); var node = new ClusterNode(this, line, origin);
// Be resilient to ":0 {master,slave},fail,noaddr" nodes // Be resilient to ":0 {master,slave},fail,noaddr" nodes, and nodes where the endpoint doesn't parse
if (node.IsNoAddr) if (node.IsNoAddr || node.EndPoint == null)
continue; continue;
// Override the origin value with the endpoint advertised with the target node to // Override the origin value with the endpoint advertised with the target node to
...@@ -309,7 +309,12 @@ internal ClusterNode(ClusterConfiguration configuration, string raw, EndPoint or ...@@ -309,7 +309,12 @@ internal ClusterNode(ClusterConfiguration configuration, string raw, EndPoint or
var flags = parts[2].Split(StringSplits.Comma); var flags = parts[2].Split(StringSplits.Comma);
EndPoint = Format.TryParseEndPoint(parts[1]); // redis 4 changes the format of "cluster nodes" - adds @... to the endpoint
var ep = parts[1];
int at = ep.IndexOf('@');
if (at >= 0) ep = ep.Substring(0, at);
EndPoint = Format.TryParseEndPoint(ep);
if (flags.Contains("myself")) if (flags.Contains("myself"))
{ {
IsMyself = true; IsMyself = true;
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
# Important: .NET 4.0 support is currently **disabled**; if you need .NET 4.0, please stick with 1.2.1 while we keep investigating # Important: .NET 4.0 support is currently **disabled**; if you need .NET 4.0, please stick with 1.2.1 while we keep investigating
## 1.2.6
- fix change to `cluster nodes` output when using cluster-enabled target and 4.0+ (see [redis #4186]https://github.com/antirez/redis/issues/4186)
## 1.2.5 ## 1.2.5
- critical fix: "poll mode" was disabled in the build for net45/net60 - impact: IO jams and lack of reader during high load - critical fix: "poll mode" was disabled in the build for net45/net60 - impact: IO jams and lack of reader during high load
......
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