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
273ee76d
Commit
273ee76d
authored
Jul 09, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove some dead code
parent
06e8e2ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
64 deletions
+0
-64
PhysicalConnection.cs
...kExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
+0
-28
SocketManager.cs
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
+0
-36
No files found.
StackExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
View file @
273ee76d
...
...
@@ -158,22 +158,14 @@ public Task FlushAsync()
}
public
void
RecordConnectionFailed
(
ConnectionFailureType
failureType
,
Exception
innerException
=
null
,
[
CallerMemberName
]
string
origin
=
null
)
{
var
mgrState
=
SocketManager
.
ManagerState
.
CheckForStaleConnections
;
RecordConnectionFailed
(
failureType
,
ref
mgrState
,
innerException
,
origin
);
}
public
void
RecordConnectionFailed
(
ConnectionFailureType
failureType
,
ref
SocketManager
.
ManagerState
managerState
,
Exception
innerException
=
null
,
[
CallerMemberName
]
string
origin
=
null
)
{
IdentifyFailureType
(
innerException
,
ref
failureType
);
managerState
=
SocketManager
.
ManagerState
.
RecordConnectionFailed_OnInternalError
;
if
(
failureType
==
ConnectionFailureType
.
InternalFailure
)
OnInternalError
(
innerException
,
origin
);
// stop anything new coming in...
Bridge
.
Trace
(
"Failed: "
+
failureType
);
int
@in
=
-
1
;
managerState
=
SocketManager
.
ManagerState
.
RecordConnectionFailed_OnDisconnected
;
Bridge
.
OnDisconnected
(
failureType
,
this
,
out
bool
isCurrent
,
out
PhysicalBridge
.
State
oldState
);
if
(
oldState
==
PhysicalBridge
.
State
.
ConnectedEstablished
)
{
...
...
@@ -186,7 +178,6 @@ public void RecordConnectionFailed(ConnectionFailureType failureType, ref Socket
if
(
isCurrent
&&
Interlocked
.
CompareExchange
(
ref
failureReported
,
1
,
0
)
==
0
)
{
managerState
=
SocketManager
.
ManagerState
.
RecordConnectionFailed_ReportFailure
;
int
now
=
Environment
.
TickCount
,
lastRead
=
Thread
.
VolatileRead
(
ref
lastReadTickCount
),
lastWrite
=
Thread
.
VolatileRead
(
ref
lastWriteTickCount
),
lastBeat
=
Thread
.
VolatileRead
(
ref
lastBeatTickCount
);
int
unansweredRead
=
Thread
.
VolatileRead
(
ref
firstUnansweredWriteTickCount
);
...
...
@@ -235,12 +226,10 @@ void add(string lk, string sk, string v)
ex
.
Data
[
"Redis-"
+
kv
.
Item1
]
=
kv
.
Item2
;
}
managerState
=
SocketManager
.
ManagerState
.
RecordConnectionFailed_OnConnectionFailed
;
Bridge
.
OnConnectionFailed
(
this
,
failureType
,
ex
);
}
// cleanup
managerState
=
SocketManager
.
ManagerState
.
RecordConnectionFailed_FailOutstanding
;
lock
(
_writtenAwaitingResponse
)
{
Bridge
.
Trace
(
_writtenAwaitingResponse
.
Count
!=
0
,
"Failing outstanding messages: "
+
_writtenAwaitingResponse
.
Count
);
...
...
@@ -254,7 +243,6 @@ void add(string lk, string sk, string v)
}
// burn the socket
managerState
=
SocketManager
.
ManagerState
.
RecordConnectionFailed_ShutdownSocket
;
Multiplexer
.
SocketManager
?.
Shutdown
(
_socket
);
}
...
...
@@ -1418,21 +1406,5 @@ public ReadOnlySequence<byte> SliceFromCurrent()
return
_buffer
.
Slice
(
from
);
}
}
partial
void
DebugEmulateStaleConnection
(
ref
int
firstUnansweredWrite
);
public
void
CheckForStaleConnection
(
ref
SocketManager
.
ManagerState
state
)
{
int
firstUnansweredWrite
=
Thread
.
VolatileRead
(
ref
firstUnansweredWriteTickCount
);
DebugEmulateStaleConnection
(
ref
firstUnansweredWrite
);
int
now
=
Environment
.
TickCount
;
if
(
firstUnansweredWrite
!=
0
&&
(
now
-
firstUnansweredWrite
)
>
Multiplexer
.
RawConfig
.
ResponseTimeout
)
{
RecordConnectionFailed
(
ConnectionFailureType
.
SocketFailure
,
ref
state
,
origin
:
"CheckForStaleConnection"
);
}
}
}
}
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
View file @
273ee76d
...
...
@@ -4,7 +4,6 @@
using
System.Net
;
using
System.Net.Sockets
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
Pipelines.Sockets.Unofficial
;
namespace
StackExchange.Redis
...
...
@@ -22,41 +21,6 @@ internal enum SocketMode
/// </summary>
public
sealed
partial
class
SocketManager
:
IDisposable
{
internal
enum
ManagerState
{
Inactive
,
Preparing
,
Faulted
,
CheckForHeartbeat
,
ExecuteHeartbeat
,
LocateActiveSockets
,
NoSocketsPause
,
PrepareActiveSockets
,
CullDeadSockets
,
NoActiveSocketsPause
,
GrowingSocketArray
,
CopyingPointersForSelect
,
ExecuteSelect
,
ExecuteSelectComplete
,
CheckForStaleConnections
,
RecordConnectionFailed_OnInternalError
,
RecordConnectionFailed_OnDisconnected
,
RecordConnectionFailed_ReportFailure
,
RecordConnectionFailed_OnConnectionFailed
,
RecordConnectionFailed_FailOutstanding
,
RecordConnectionFailed_ShutdownSocket
,
CheckForStaleConnectionsDone
,
EnqueueRead
,
EnqueueError
,
EnqueueReadFallback
,
RequestAssistance
,
ProcessQueues
,
ProcessReadQueue
,
ProcessErrorQueue
,
}
/// <summary>
/// Gets the name of this SocketManager instance
/// </summary>
...
...
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