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
09f9d8ab
Commit
09f9d8ab
authored
Feb 03, 2017
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid overlapped per-endpoint heartbeats and heartbeat error reports; we don't want them backing up
parent
d881e28c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
ConnectionMultiplexer.cs
...change.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
+15
-2
ServerEndPoint.cs
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
+19
-7
No files found.
StackExchange.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
View file @
09f9d8ab
...
...
@@ -970,6 +970,8 @@ private ConnectionMultiplexer(ConfigurationOptions configuration)
{
((
ConnectionMultiplexer
)
state
).
OnHeartbeat
();
};
private
int
_activeHeartbeatErrors
;
private
void
OnHeartbeat
()
{
try
...
...
@@ -982,9 +984,20 @@ private void OnHeartbeat()
var
tmp
=
serverSnapshot
;
for
(
int
i
=
0
;
i
<
tmp
.
Length
;
i
++)
tmp
[
i
].
OnHeartbeat
();
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
OnInternalError
(
ex
);
if
(
Interlocked
.
CompareExchange
(
ref
_activeHeartbeatErrors
,
1
,
0
)
==
0
)
{
try
{
OnInternalError
(
ex
);
}
finally
{
Interlocked
.
Exchange
(
ref
_activeHeartbeatErrors
,
0
);
}
}
}
}
...
...
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
View file @
09f9d8ab
...
...
@@ -7,6 +7,7 @@
using
System.Runtime.CompilerServices
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
StackExchange.Redis
...
...
@@ -531,17 +532,28 @@ internal bool CheckInfoReplication()
}
private
int
lastInfoReplicationCheckTicks
;
private
int
_heartBeatActive
;
internal
void
OnHeartbeat
()
{
try
{
interactive
?.
OnHeartbeat
(
false
);
subscription
?.
OnHeartbeat
(
false
);
}
catch
(
Exception
ex
)
// don't overlap operations on an endpoint
if
(
Interlocked
.
CompareExchange
(
ref
_heartBeatActive
,
1
,
0
)
==
0
)
{
multiplexer
.
OnInternalError
(
ex
,
EndPoint
);
}
try
{
interactive
?.
OnHeartbeat
(
false
);
subscription
?.
OnHeartbeat
(
false
);
}
catch
(
Exception
ex
)
{
multiplexer
.
OnInternalError
(
ex
,
EndPoint
);
}
finally
{
Interlocked
.
Exchange
(
ref
_heartBeatActive
,
0
);
}
}
}
internal
Task
<
T
>
QueueDirectAsync
<
T
>(
Message
message
,
ResultProcessor
<
T
>
processor
,
object
asyncState
=
null
,
PhysicalBridge
bridge
=
null
)
...
...
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