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
6aee9105
Commit
6aee9105
authored
Jul 05, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove all the `asyncCompletionQueue` stuff; no longer makes sense
parent
0222f5d8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
69 deletions
+8
-69
MassiveOps.cs
StackExchange.Redis.Tests/MassiveOps.cs
+0
-3
CompletionManager.cs
StackExchange.Redis/StackExchange/Redis/CompletionManager.cs
+1
-34
ConnectionMultiplexer.cs
...change.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
+2
-4
DebuggingAids.cs
StackExchange.Redis/StackExchange/Redis/DebuggingAids.cs
+0
-16
PhysicalBridge.cs
StackExchange.Redis/StackExchange/Redis/PhysicalBridge.cs
+1
-4
RedisSubscriber.cs
StackExchange.Redis/StackExchange/Redis/RedisSubscriber.cs
+1
-4
ServerEndPoint.cs
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
+3
-4
No files found.
StackExchange.Redis.Tests/MassiveOps.cs
View file @
6aee9105
...
...
@@ -42,9 +42,6 @@ public async Task MassiveBulkOpsAsync(bool withContinuation)
Output
.
WriteLine
(
"{2}: Time for {0} ops: {1}ms ({3}, {4}); ops/s: {5}"
,
AsyncOpsQty
,
watch
.
ElapsedMilliseconds
,
Me
(),
withContinuation
?
"with continuation"
:
"no continuation"
,
"any order"
,
AsyncOpsQty
/
watch
.
Elapsed
.
TotalSeconds
);
#if DEBUG
Output
.
WriteLine
(
"Async completion workers: "
+
(
ConnectionMultiplexer
.
GetAsyncCompletionWorkerCount
()
-
oldAsyncCompletionCount
));
#endif
}
}
...
...
StackExchange.Redis/StackExchange/Redis/CompletionManager.cs
View file @
6aee9105
...
...
@@ -7,8 +7,6 @@ namespace StackExchange.Redis
{
internal
sealed
partial
class
CompletionManager
{
private
readonly
Queue
<
ICompletable
>
asyncCompletionQueue
=
new
Queue
<
ICompletable
>();
private
readonly
ConnectionMultiplexer
multiplexer
;
private
readonly
string
name
;
...
...
@@ -38,39 +36,11 @@ public void CompleteSyncOrAsync(ICompletable operation)
internal
void
GetCounters
(
ConnectionCounters
counters
)
{
lock
(
asyncCompletionQueue
)
{
counters
.
ResponsesAwaitingAsyncCompletion
=
asyncCompletionQueue
.
Count
;
}
counters
.
CompletedSynchronously
=
Interlocked
.
Read
(
ref
completedSync
);
counters
.
CompletedAsynchronously
=
Interlocked
.
Read
(
ref
completedAsync
);
counters
.
FailedAsynchronously
=
Interlocked
.
Read
(
ref
failedAsync
);
}
internal
int
GetOutstandingCount
()
{
lock
(
asyncCompletionQueue
)
{
return
asyncCompletionQueue
.
Count
;
}
}
internal
void
GetStormLog
(
StringBuilder
sb
)
{
lock
(
asyncCompletionQueue
)
{
if
(
asyncCompletionQueue
.
Count
==
0
)
return
;
sb
.
Append
(
"Response awaiting completion: "
).
Append
(
asyncCompletionQueue
.
Count
).
AppendLine
();
int
total
=
0
;
foreach
(
var
item
in
asyncCompletionQueue
)
{
if
(++
total
>=
500
)
break
;
item
.
AppendStormLog
(
sb
);
sb
.
AppendLine
();
}
}
}
private
static
readonly
Action
<
object
>
s_AnyOrderCompletionHandler
=
AnyOrderCompletionHandler
;
private
static
void
AnyOrderCompletionHandler
(
object
state
)
{
...
...
@@ -83,9 +53,6 @@ private static void AnyOrderCompletionHandler(object state)
{
ConnectionMultiplexer
.
TraceWithoutContext
(
"Async completion error: "
+
ex
.
Message
);
}
}
partial
void
OnCompletedAsync
();
}
}
}
StackExchange.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
View file @
6aee9105
...
...
@@ -2041,11 +2041,9 @@ void add(string lk, string sk, string v)
}
}
int
queue
=
server
.
GetOutstandingCount
(
message
.
Command
,
out
int
inst
,
out
int
qs
,
out
int
qc
,
out
int
@in
);
server
.
GetOutstandingCount
(
message
.
Command
,
out
int
inst
,
out
int
qs
,
out
int
@in
);
add
(
"Instantaneous"
,
"inst"
,
inst
.
ToString
());
add
(
"Queue-Length"
,
"queue"
,
queue
.
ToString
());
add
(
"Queue-Awaiting-Response"
,
"qs"
,
qs
.
ToString
());
add
(
"Queue-Completion-Outstanding"
,
"qc"
,
qc
.
ToString
());
add
(
"Inbound-Bytes"
,
"in"
,
@in
.
ToString
());
add
(
"Manager"
,
"mgr"
,
SocketManager
?.
GetState
());
...
...
@@ -2071,7 +2069,7 @@ void add(string lk, string sk, string v)
sb
.
Append
(
timeoutHelpLink
);
sb
.
Append
(
")"
);
errMessage
=
sb
.
ToString
();
if
(
StormLogThreshold
>=
0
&&
q
ueue
>=
StormLogThreshold
&&
Interlocked
.
CompareExchange
(
ref
haveStormLog
,
1
,
0
)
==
0
)
if
(
StormLogThreshold
>=
0
&&
q
s
>=
StormLogThreshold
&&
Interlocked
.
CompareExchange
(
ref
haveStormLog
,
1
,
0
)
==
0
)
{
var
log
=
server
.
GetStormLog
(
message
.
Command
);
if
(
string
.
IsNullOrWhiteSpace
(
log
))
Interlocked
.
Exchange
(
ref
haveStormLog
,
0
);
...
...
StackExchange.Redis/StackExchange/Redis/DebuggingAids.cs
View file @
6aee9105
...
...
@@ -129,17 +129,6 @@ void IServer.Hang(TimeSpan duration, CommandFlags flags)
}
}
internal
partial
class
CompletionManager
{
private
static
long
asyncCompletionWorkerCount
;
#pragma warning disable RCS1047 // Non-asynchronous method name should not end with 'Async'.
partial
void
OnCompletedAsync
()
=>
Interlocked
.
Increment
(
ref
asyncCompletionWorkerCount
);
#pragma warning restore RCS1047 // Non-asynchronous method name should not end with 'Async'.
internal
static
long
GetAsyncCompletionWorkerCount
()
=>
Interlocked
.
Read
(
ref
asyncCompletionWorkerCount
);
}
public
partial
class
ConnectionMultiplexer
{
/// <summary>
...
...
@@ -147,11 +136,6 @@ public partial class ConnectionMultiplexer
/// </summary>
public
static
long
GetResultBoxAllocationCount
()
=>
ResultBox
.
GetAllocationCount
();
/// <summary>
/// Gets how many async completion workers were queueud
/// </summary>
public
static
long
GetAsyncCompletionWorkerCount
()
=>
CompletionManager
.
GetAsyncCompletionWorkerCount
();
private
volatile
bool
allowConnect
=
true
,
ignoreConnect
=
false
;
...
...
StackExchange.Redis/StackExchange/Redis/PhysicalBridge.cs
View file @
6aee9105
...
...
@@ -177,7 +177,7 @@ internal void GetCounters(ConnectionCounters counters)
physical
?.
GetCounters
(
counters
);
}
internal
int
GetOutstandingCount
(
out
int
inst
,
out
int
qs
,
out
int
qc
,
out
int
@in
)
internal
void
GetOutstandingCount
(
out
int
inst
,
out
int
qs
,
out
int
@in
)
{
// defined as: PendingUnsentItems + SentItemsAwaitingResponse + ResponsesAwaitingAsyncCompletion
inst
=
(
int
)(
Interlocked
.
Read
(
ref
operationCount
)
-
Interlocked
.
Read
(
ref
profileLastLog
));
var
tmp
=
physical
;
...
...
@@ -190,8 +190,6 @@ internal int GetOutstandingCount(out int inst, out int qs, out int qc, out int @
qs
=
tmp
.
GetSentAwaitingResponseCount
();
@in
=
tmp
.
GetAvailableInboundBytes
();
}
qc
=
completionManager
.
GetOutstandingCount
();
return
qs
+
qc
;
}
internal
string
GetStormLog
()
...
...
@@ -200,7 +198,6 @@ internal string GetStormLog()
.
Append
(
" at "
).
Append
(
DateTime
.
UtcNow
)
.
AppendLine
().
AppendLine
();
physical
?.
GetStormLog
(
sb
);
completionManager
.
GetStormLog
(
sb
);
sb
.
Append
(
"Circular op-count snapshot:"
);
AppendProfile
(
sb
);
sb
.
AppendLine
();
...
...
StackExchange.Redis/StackExchange/Redis/RedisSubscriber.cs
View file @
6aee9105
...
...
@@ -86,10 +86,7 @@ internal Task RemoveAllSubscriptions(CommandFlags flags, object asyncState)
foreach
(
var
pair
in
subscriptions
)
{
var
msg
=
pair
.
Value
.
ForSyncShutdown
();
if
(
msg
!=
null
)
{
// TODO: execute
}
if
(
msg
!=
null
)
UnprocessableCompletionManager
?.
CompleteSyncOrAsync
(
msg
);
pair
.
Value
.
Remove
(
true
,
null
);
pair
.
Value
.
Remove
(
false
,
null
);
...
...
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
View file @
6aee9105
...
...
@@ -367,15 +367,14 @@ internal ServerCounters GetCounters()
return
counters
;
}
internal
int
GetOutstandingCount
(
RedisCommand
command
,
out
int
inst
,
out
int
qs
,
out
int
qc
,
out
int
@in
)
internal
void
GetOutstandingCount
(
RedisCommand
command
,
out
int
inst
,
out
int
qs
,
out
int
@in
)
{
var
bridge
=
GetBridge
(
command
,
false
);
if
(
bridge
==
null
)
{
return
inst
=
qs
=
qc
=
@in
=
0
;
inst
=
qs
=
@in
=
0
;
}
return
bridge
.
GetOutstandingCount
(
out
inst
,
out
qs
,
out
qc
,
out
@in
);
bridge
.
GetOutstandingCount
(
out
inst
,
out
qs
,
out
@in
);
}
internal
string
GetProfile
()
...
...
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