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
a9790b9e
Commit
a9790b9e
authored
Aug 13, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moar trace
parent
ab5327cf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
TestBase.cs
StackExchange.Redis.Tests/TestBase.cs
+1
-1
PhysicalBridge.cs
StackExchange.Redis/PhysicalBridge.cs
+11
-2
RedisSubscriber.cs
StackExchange.Redis/RedisSubscriber.cs
+3
-3
ResultProcessor.cs
StackExchange.Redis/ResultProcessor.cs
+1
-0
No files found.
StackExchange.Redis.Tests/TestBase.cs
View file @
a9790b9e
...
@@ -284,7 +284,7 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
...
@@ -284,7 +284,7 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
};
};
muxer
.
Connecting
+=
(
e
,
t
)
=>
Writer
.
WriteLine
(
$"Connecting to
{
Format
.
ToString
(
e
)}
as
{
t
}
"
);
muxer
.
Connecting
+=
(
e
,
t
)
=>
Writer
.
WriteLine
(
$"Connecting to
{
Format
.
ToString
(
e
)}
as
{
t
}
"
);
muxer
.
TransactionLog
+=
msg
=>
{
lock
(
Writer
)
{
Writer
.
WriteLine
(
"tran: "
+
msg
);
}
};
muxer
.
TransactionLog
+=
msg
=>
{
lock
(
Writer
)
{
Writer
.
WriteLine
(
"tran: "
+
msg
);
}
};
muxer
.
Heartbeat
+=
msg
=>
Writer
.
WriteLine
(
$"
{
Time
()}
:
{
msg
}
"
);
muxer
.
InfoMessage
+=
msg
=>
Writer
.
WriteLine
(
msg
);
muxer
.
Resurrecting
+=
(
e
,
t
)
=>
Writer
.
WriteLine
(
$"Resurrecting
{
Format
.
ToString
(
e
)}
as
{
t
}
"
);
muxer
.
Resurrecting
+=
(
e
,
t
)
=>
Writer
.
WriteLine
(
$"Resurrecting
{
Format
.
ToString
(
e
)}
as
{
t
}
"
);
muxer
.
Closing
+=
complete
=>
Writer
.
WriteLine
(
complete
?
"Closed"
:
"Closing..."
);
muxer
.
Closing
+=
complete
=>
Writer
.
WriteLine
(
complete
?
"Closed"
:
"Closing..."
);
return
muxer
;
return
muxer
;
...
...
StackExchange.Redis/PhysicalBridge.cs
View file @
a9790b9e
...
@@ -262,7 +262,7 @@ internal void KeepAlive()
...
@@ -262,7 +262,7 @@ internal void KeepAlive()
{
{
msg
.
SetInternalCall
();
msg
.
SetInternalCall
();
Multiplexer
.
Trace
(
"Enqueue: "
+
msg
);
Multiplexer
.
Trace
(
"Enqueue: "
+
msg
);
Multiplexer
.
On
Heartbeat
(
$"heartbeat '
{
msg
.
CommandAndKey
}
' on '
{
PhysicalName
}
' (v
{
features
.
Version
}
)"
);
Multiplexer
.
On
InfoMessage
(
$"heartbeat '
{
msg
.
CommandAndKey
}
' on '
{
PhysicalName
}
' (v
{
features
.
Version
}
)"
);
var
result
=
TryWrite
(
msg
,
ServerEndPoint
.
IsSlave
);
var
result
=
TryWrite
(
msg
,
ServerEndPoint
.
IsSlave
);
if
(
result
!=
WriteResult
.
Success
)
if
(
result
!=
WriteResult
.
Success
)
...
@@ -534,6 +534,7 @@ internal bool TryEnqueue(List<Message> messages, bool isSlave)
...
@@ -534,6 +534,7 @@ internal bool TryEnqueue(List<Message> messages, bool isSlave)
private
readonly
object
SingleWriterLock
=
new
object
();
private
readonly
object
SingleWriterLock
=
new
object
();
private
int
reentrantCount
=
0
;
/// <summary>
/// <summary>
/// This writes a message to the output stream
/// This writes a message to the output stream
/// </summary>
/// </summary>
...
@@ -557,6 +558,10 @@ internal WriteResult WriteMessageTakingWriteLock(PhysicalConnection physical, Me
...
@@ -557,6 +558,10 @@ internal WriteResult WriteMessageTakingWriteLock(PhysicalConnection physical, Me
return
WriteResult
.
TimeoutBeforeWrite
;
return
WriteResult
.
TimeoutBeforeWrite
;
}
}
if
(
reentrantCount
++
!=
0
)
{
Multiplexer
?.
OnInfoMessage
(
"reentrant call to WriteMessageTakingWriteLock for "
+
message
.
CommandAndKey
);
}
var
messageIsSent
=
false
;
var
messageIsSent
=
false
;
if
(
message
is
IMultiMessage
)
if
(
message
is
IMultiMessage
)
{
{
...
@@ -592,7 +597,11 @@ internal WriteResult WriteMessageTakingWriteLock(PhysicalConnection physical, Me
...
@@ -592,7 +597,11 @@ internal WriteResult WriteMessageTakingWriteLock(PhysicalConnection physical, Me
}
}
finally
finally
{
{
if
(
haveLock
)
Monitor
.
Exit
(
SingleWriterLock
);
if
(
haveLock
)
{
reentrantCount
--;
Monitor
.
Exit
(
SingleWriterLock
);
}
}
}
return
result
;
return
result
;
...
...
StackExchange.Redis/RedisSubscriber.cs
View file @
a9790b9e
...
@@ -254,7 +254,7 @@ internal string GetConnectionName(EndPoint endPoint, ConnectionType connectionTy
...
@@ -254,7 +254,7 @@ internal string GetConnectionName(EndPoint endPoint, ConnectionType connectionTy
internal
event
Action
<
string
,
Exception
,
string
>
MessageFaulted
;
internal
event
Action
<
string
,
Exception
,
string
>
MessageFaulted
;
internal
event
Action
<
bool
>
Closing
;
internal
event
Action
<
bool
>
Closing
;
internal
event
Action
<
string
>
PreTransactionExec
,
TransactionLog
,
Heartbeat
;
internal
event
Action
<
string
>
PreTransactionExec
,
TransactionLog
,
InfoMessage
;
internal
event
Action
<
EndPoint
,
ConnectionType
>
Connecting
;
internal
event
Action
<
EndPoint
,
ConnectionType
>
Connecting
;
internal
event
Action
<
EndPoint
,
ConnectionType
>
Resurrecting
;
internal
event
Action
<
EndPoint
,
ConnectionType
>
Resurrecting
;
...
@@ -262,9 +262,9 @@ internal void OnMessageFaulted(Message msg, Exception fault, [CallerMemberName]
...
@@ -262,9 +262,9 @@ internal void OnMessageFaulted(Message msg, Exception fault, [CallerMemberName]
{
{
MessageFaulted
?.
Invoke
(
msg
?.
CommandAndKey
,
fault
,
$"
{
origin
}
(
{
path
}
#
{
lineNumber
}
)"
);
MessageFaulted
?.
Invoke
(
msg
?.
CommandAndKey
,
fault
,
$"
{
origin
}
(
{
path
}
#
{
lineNumber
}
)"
);
}
}
internal
void
On
Heartbeat
(
string
message
)
internal
void
On
InfoMessage
(
string
message
)
{
{
Heartbeat
?.
Invoke
(
message
);
InfoMessage
?.
Invoke
(
message
);
}
}
internal
void
OnClosing
(
bool
complete
)
internal
void
OnClosing
(
bool
complete
)
...
...
StackExchange.Redis/ResultProcessor.cs
View file @
a9790b9e
...
@@ -1799,6 +1799,7 @@ public TracerProcessor(bool establishConnection)
...
@@ -1799,6 +1799,7 @@ public TracerProcessor(bool establishConnection)
public
override
bool
SetResult
(
PhysicalConnection
connection
,
Message
message
,
RawResult
result
)
public
override
bool
SetResult
(
PhysicalConnection
connection
,
Message
message
,
RawResult
result
)
{
{
connection
?.
BridgeCouldBeNull
?.
Multiplexer
.
OnInfoMessage
(
$"got '
{
result
}
' for '
{
message
.
CommandAndKey
}
' on '
{
connection
}
'"
);
var
final
=
base
.
SetResult
(
connection
,
message
,
result
);
var
final
=
base
.
SetResult
(
connection
,
message
,
result
);
if
(
result
.
IsError
)
if
(
result
.
IsError
)
{
{
...
...
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