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
092c5ac9
Commit
092c5ac9
authored
Aug 13, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
be less twitchy about errors from Read that happen once we've already burned the pipe
parent
a9790b9e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
ConnectionMultiplexer.cs
StackExchange.Redis/ConnectionMultiplexer.cs
+1
-1
PhysicalConnection.cs
StackExchange.Redis/PhysicalConnection.cs
+15
-3
No files found.
StackExchange.Redis/ConnectionMultiplexer.cs
View file @
092c5ac9
...
@@ -155,8 +155,8 @@ internal void OnInternalError(Exception exception, EndPoint endpoint = null, Con
...
@@ -155,8 +155,8 @@ internal void OnInternalError(Exception exception, EndPoint endpoint = null, Con
{
{
try
try
{
{
Trace
(
"Internal error: "
+
origin
+
", "
+
exception
==
null
?
"unknown"
:
exception
.
Message
);
if
(
_isDisposed
)
return
;
if
(
_isDisposed
)
return
;
Trace
(
"Internal error: "
+
origin
+
", "
+
exception
==
null
?
"unknown"
:
exception
.
Message
);
var
handler
=
InternalError
;
var
handler
=
InternalError
;
if
(
handler
!=
null
)
if
(
handler
!=
null
)
{
{
...
...
StackExchange.Redis/PhysicalConnection.cs
View file @
092c5ac9
...
@@ -1274,9 +1274,9 @@ private void OnDebugAbort()
...
@@ -1274,9 +1274,9 @@ private void OnDebugAbort()
private
async
void
ReadFromPipe
()
// yes it is an async void; deal with it!
private
async
void
ReadFromPipe
()
// yes it is an async void; deal with it!
{
{
bool
allowSyncRead
=
true
,
isReading
=
false
;
try
try
{
{
bool
allowSyncRead
=
true
;
while
(
true
)
while
(
true
)
{
{
var
input
=
_ioPipe
?.
Input
;
var
input
=
_ioPipe
?.
Input
;
...
@@ -1284,10 +1284,12 @@ private void OnDebugAbort()
...
@@ -1284,10 +1284,12 @@ private void OnDebugAbort()
// note: TryRead will give us back the same buffer in a tight loop
// note: TryRead will give us back the same buffer in a tight loop
// - so: only use that if we're making progress
// - so: only use that if we're making progress
isReading
=
true
;
if
(!(
allowSyncRead
&&
input
.
TryRead
(
out
var
readResult
)))
if
(!(
allowSyncRead
&&
input
.
TryRead
(
out
var
readResult
)))
{
{
readResult
=
await
input
.
ReadAsync
().
ForAwait
();
readResult
=
await
input
.
ReadAsync
().
ForAwait
();
}
}
isReading
=
false
;
var
buffer
=
readResult
.
Buffer
;
var
buffer
=
readResult
.
Buffer
;
int
handled
=
0
;
int
handled
=
0
;
...
@@ -1310,11 +1312,21 @@ private void OnDebugAbort()
...
@@ -1310,11 +1312,21 @@ private void OnDebugAbort()
RecordConnectionFailed
(
ConnectionFailureType
.
SocketClosed
);
RecordConnectionFailed
(
ConnectionFailureType
.
SocketClosed
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
// this CEX is just a hardcore "seriously, read the actual value" - there's no
// convenient "Thread.VolatileRead<T>(ref T field) where T : class", and I don't
// want to make the field volatile just for this one place that needs it
if
(
isReading
&&
Interlocked
.
CompareExchange
(
ref
_ioPipe
,
null
,
null
)
==
null
)
{
// yeah, that's fine... don't worry about it
}
else
{
{
Trace
(
"Faulted"
);
Trace
(
"Faulted"
);
RecordConnectionFailed
(
ConnectionFailureType
.
InternalFailure
,
ex
);
RecordConnectionFailed
(
ConnectionFailureType
.
InternalFailure
,
ex
);
}
}
}
}
}
private
int
ProcessBuffer
(
ref
ReadOnlySequence
<
byte
>
buffer
)
private
int
ProcessBuffer
(
ref
ReadOnlySequence
<
byte
>
buffer
)
{
{
...
...
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