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
6ba8f745
Commit
6ba8f745
authored
Jul 04, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix one more large slice based on the BufferReader; also increase default segment size
parent
079db398
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
PhysicalConnection.cs
...kExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
+8
-2
SocketManager.cs
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
+3
-3
No files found.
StackExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
View file @
6ba8f745
...
...
@@ -1079,7 +1079,7 @@ private int ProcessBuffer(ref ReadOnlySequence<byte> buffer)
{
if
(
result
.
HasValue
)
{
buffer
=
buffer
.
Slice
(
reader
.
TotalConsumed
);
buffer
=
reader
.
SliceFromCurrent
(
);
messageCount
++;
Multiplexer
.
Trace
(
result
.
ToString
(),
physicalName
);
...
...
@@ -1243,7 +1243,7 @@ public enum ConsumeResult
public
ReadOnlySpan
<
byte
>
SlicedSpan
=>
_current
.
Slice
(
OffsetThisSpan
,
RemainingThisSpan
);
public
int
OffsetThisSpan
{
get
;
private
set
;
}
p
ublic
int
TotalConsumed
{
get
;
private
set
;
}
p
rivate
int
TotalConsumed
{
get
;
set
;
}
// hide this; callers should use the snapshot-aware methods instead
public
int
RemainingThisSpan
{
get
;
private
set
;
}
public
bool
IsEmpty
=>
RemainingThisSpan
==
0
;
...
...
@@ -1413,6 +1413,12 @@ public int ConsumeByte()
Consume
(
1
);
return
value
;
}
public
ReadOnlySequence
<
byte
>
SliceFromCurrent
()
{
var
from
=
SnapshotPosition
();
return
_buffer
.
Slice
(
from
);
}
}
partial
void
DebugEmulateStaleConnection
(
ref
int
firstUnansweredWrite
);
...
...
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
View file @
6ba8f745
...
...
@@ -147,7 +147,7 @@ internal static SocketManager Shared
public
SocketManager
(
string
name
,
bool
useHighPrioritySocketThreads
)
:
this
(
name
,
useHighPrioritySocketThreads
,
DEFAULT_MIN_THREADS
,
DEFAULT_MAX_THREADS
)
{
}
private
const
int
DEFAULT_MIN_THREADS
=
1
,
DEFAULT_MAX_THREADS
=
5
;
private
const
int
DEFAULT_MIN_THREADS
=
1
,
DEFAULT_MAX_THREADS
=
5
,
MINIMUM_SEGMENT_SIZE
=
8
*
1024
;
private
SocketManager
(
string
name
,
bool
useHighPrioritySocketThreads
,
int
minThreads
,
int
maxThreads
)
{
...
...
@@ -165,13 +165,13 @@ private SocketManager(string name, bool useHighPrioritySocketThreads, int minThr
defaultPipeOptions
.
Pool
,
_scheduler
,
_scheduler
,
pauseWriterThreshold
:
defaultPipeOptions
.
PauseWriterThreshold
,
resumeWriterThreshold
:
defaultPipeOptions
.
ResumeWriterThreshold
,
defaultPipeOptions
.
MinimumSegmentSize
,
minimumSegmentSize
:
Math
.
Max
(
defaultPipeOptions
.
MinimumSegmentSize
,
MINIMUM_SEGMENT_SIZE
)
,
useSynchronizationContext
:
false
);
ReceivePipeOptions
=
new
PipeOptions
(
defaultPipeOptions
.
Pool
,
_scheduler
,
_scheduler
,
pauseWriterThreshold
:
Receive_PauseWriterThreshold
,
resumeWriterThreshold
:
Receive_ResumeWriterThreshold
,
defaultPipeOptions
.
MinimumSegmentSize
,
minimumSegmentSize
:
Math
.
Max
(
defaultPipeOptions
.
MinimumSegmentSize
,
MINIMUM_SEGMENT_SIZE
)
,
useSynchronizationContext
:
false
);
}
...
...
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