Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
49032af6
Commit
49032af6
authored
Nov 16, 2015
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add resilience to known nodes with the noaddr flag.
parent
9a4e4087
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
ClusterConfiguration.cs
...xchange.Redis/StackExchange/Redis/ClusterConfiguration.cs
+11
-0
No files found.
StackExchange.Redis/StackExchange/Redis/ClusterConfiguration.cs
View file @
49032af6
...
...
@@ -182,6 +182,9 @@ internal ClusterConfiguration(ServerSelectionStrategy serverSelectionStrategy, s
if
(
string
.
IsNullOrWhiteSpace
(
line
))
continue
;
var
node
=
new
ClusterNode
(
this
,
line
,
origin
);
// Be resilient to ":0 {master,slave},fail,noaddr" nodes
if
(
node
.
IsNoAddr
)
continue
;
nodeLookup
.
Add
(
node
.
EndPoint
,
node
);
}
}
...
...
@@ -262,6 +265,8 @@ public sealed class ClusterNode : IEquatable<ClusterNode>, IComparable<ClusterN
private
readonly
bool
isSlave
;
private
readonly
bool
isNoAddr
;
private
readonly
string
nodeId
,
parentNodeId
,
raw
;
private
readonly
IList
<
SlotRange
>
slots
;
...
...
@@ -291,6 +296,7 @@ internal ClusterNode(ClusterConfiguration configuration, string raw, EndPoint or
}
nodeId
=
parts
[
0
];
isSlave
=
flags
.
Contains
(
"slave"
);
isNoAddr
=
flags
.
Contains
(
"noaddr"
);
parentNodeId
=
string
.
IsNullOrWhiteSpace
(
parts
[
3
])
?
null
:
parts
[
3
];
List
<
SlotRange
>
slots
=
null
;
...
...
@@ -339,6 +345,11 @@ public IList<ClusterNode> Children
/// </summary>
public
bool
IsSlave
{
get
{
return
isSlave
;
}
}
/// <summary>
/// Gets whether this node is flagged as noaddr
/// </summary>
public
bool
IsNoAddr
{
get
{
return
isNoAddr
;
}
}
/// <summary>
/// Gets the unique node-id of the current node
/// </summary>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment