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
1dcf55e1
Commit
1dcf55e1
authored
Mar 23, 2020
by
mgravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix plinq glitch
parent
49f24a2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
ConnectionMultiplexer.cs
src/StackExchange.Redis/ConnectionMultiplexer.cs
+14
-6
No files found.
src/StackExchange.Redis/ConnectionMultiplexer.cs
View file @
1dcf55e1
...
@@ -913,7 +913,7 @@ public override string ToString()
...
@@ -913,7 +913,7 @@ public override string ToString()
string
s
=
null
;
string
s
=
null
;
if
(
_log
!=
null
)
if
(
_log
!=
null
)
{
{
lock
(
SyncLock
)
lock
(
SyncLock
)
{
{
s
=
_log
?.
ToString
();
s
=
_log
?.
ToString
();
}
}
...
@@ -2254,7 +2254,7 @@ internal void OnManagedConnectionRestored(object sender, ConnectionFailedEventAr
...
@@ -2254,7 +2254,7 @@ internal void OnManagedConnectionRestored(object sender, ConnectionFailedEventAr
{
{
ConnectionMultiplexer
connection
=
(
ConnectionMultiplexer
)
sender
;
ConnectionMultiplexer
connection
=
(
ConnectionMultiplexer
)
sender
;
if
(
connection
.
sentinelMasterReconnectTimer
!=
null
)
if
(
connection
.
sentinelMasterReconnectTimer
!=
null
)
{
{
connection
.
sentinelMasterReconnectTimer
.
Dispose
();
connection
.
sentinelMasterReconnectTimer
.
Dispose
();
connection
.
sentinelMasterReconnectTimer
=
null
;
connection
.
sentinelMasterReconnectTimer
=
null
;
...
@@ -2268,7 +2268,7 @@ internal void OnManagedConnectionRestored(object sender, ConnectionFailedEventAr
...
@@ -2268,7 +2268,7 @@ internal void OnManagedConnectionRestored(object sender, ConnectionFailedEventAr
{
{
// Verify that the reconnected endpoint is a master,
// Verify that the reconnected endpoint is a master,
// and the correct one otherwise we should reconnect
// and the correct one otherwise we should reconnect
if
(
connection
.
GetServer
(
e
.
EndPoint
).
IsSlave
||
e
.
EndPoint
!=
connection
.
currentSentinelMasterEndPoint
)
if
(
connection
.
GetServer
(
e
.
EndPoint
).
IsSlave
||
e
.
EndPoint
!=
connection
.
currentSentinelMasterEndPoint
)
{
{
// Wait for things to smooth out
// Wait for things to smooth out
Thread
.
Sleep
(
200
);
Thread
.
Sleep
(
200
);
...
@@ -2277,7 +2277,7 @@ internal void OnManagedConnectionRestored(object sender, ConnectionFailedEventAr
...
@@ -2277,7 +2277,7 @@ internal void OnManagedConnectionRestored(object sender, ConnectionFailedEventAr
SwitchMaster
(
e
.
EndPoint
,
connection
);
SwitchMaster
(
e
.
EndPoint
,
connection
);
}
}
}
}
catch
(
Exception
)
catch
(
Exception
)
{
{
// If we get here it means that we tried to reconnect to a server that is no longer
// If we get here it means that we tried to reconnect to a server that is no longer
// considered a master by Sentinel and was removed from the list of endpoints.
// considered a master by Sentinel and was removed from the list of endpoints.
...
@@ -2311,7 +2311,11 @@ internal void OnManagedConnectionFailed(object sender, ConnectionFailedEventArgs
...
@@ -2311,7 +2311,11 @@ internal void OnManagedConnectionFailed(object sender, ConnectionFailedEventArgs
.
ToArray
()
.
ToArray
()
.
Where
(
s
=>
s
.
ServerType
==
ServerType
.
Sentinel
)
.
Where
(
s
=>
s
.
ServerType
==
ServerType
.
Sentinel
)
.
AsParallel
()
.
AsParallel
()
.
Select
(
s
=>
GetServer
(
s
.
EndPoint
).
SentinelGetMasterAddressByName
(
serviceName
))
.
Select
(
s
=>
{
try
{
return
GetServer
(
s
.
EndPoint
).
SentinelGetMasterAddressByName
(
serviceName
);
}
catch
{
return
null
;
}
})
.
First
(
r
=>
r
!=
null
);
.
First
(
r
=>
r
!=
null
);
internal
EndPoint
currentSentinelMasterEndPoint
;
internal
EndPoint
currentSentinelMasterEndPoint
;
...
@@ -2388,7 +2392,11 @@ internal void UpdateSentinelAddressList(string serviceName)
...
@@ -2388,7 +2392,11 @@ internal void UpdateSentinelAddressList(string serviceName)
.
ToArray
()
.
ToArray
()
.
Where
(
s
=>
s
.
ServerType
==
ServerType
.
Sentinel
)
.
Where
(
s
=>
s
.
ServerType
==
ServerType
.
Sentinel
)
.
AsParallel
()
.
AsParallel
()
.
Select
(
s
=>
GetServer
(
s
.
EndPoint
).
SentinelGetSentinelAddresses
(
serviceName
))
.
Select
(
s
=>
{
try
{
return
GetServer
(
s
.
EndPoint
).
SentinelGetSentinelAddresses
(
serviceName
);
}
catch
{
return
null
;
}
})
.
First
(
r
=>
r
!=
null
);
.
First
(
r
=>
r
!=
null
);
// Ignore errors, as having an updated sentinel list is
// Ignore errors, as having an updated sentinel list is
...
...
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