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
77633383
Commit
77633383
authored
Aug 15, 2018
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove GCHandle (screws with GC testing)
parent
8d015446
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
22 deletions
+1
-22
TestBase.cs
StackExchange.Redis.Tests/TestBase.cs
+1
-22
No files found.
StackExchange.Redis.Tests/TestBase.cs
View file @
77633383
...
@@ -200,8 +200,6 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
...
@@ -200,8 +200,6 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
throw
new
InvalidOperationException
(
"Requires a master endpoint (found none)"
);
throw
new
InvalidOperationException
(
"Requires a master endpoint (found none)"
);
}
}
private
static
readonly
HashSet
<
GCHandle
>
ActiveMultiplexers
=
new
HashSet
<
GCHandle
>();
protected
virtual
ConnectionMultiplexer
Create
(
protected
virtual
ConnectionMultiplexer
Create
(
string
clientName
=
null
,
int
?
syncTimeout
=
null
,
bool
?
allowAdmin
=
null
,
int
?
keepAlive
=
null
,
string
clientName
=
null
,
int
?
syncTimeout
=
null
,
bool
?
allowAdmin
=
null
,
int
?
keepAlive
=
null
,
int
?
connectTimeout
=
null
,
string
password
=
null
,
string
tieBreaker
=
null
,
TextWriter
log
=
null
,
int
?
connectTimeout
=
null
,
string
password
=
null
,
string
tieBreaker
=
null
,
TextWriter
log
=
null
,
...
@@ -212,7 +210,6 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
...
@@ -212,7 +210,6 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
[
CallerMemberName
]
string
caller
=
null
)
[
CallerMemberName
]
string
caller
=
null
)
{
{
StringWriter
localLog
=
null
;
StringWriter
localLog
=
null
;
GCHandle
handle
;
if
(
log
==
null
)
if
(
log
==
null
)
{
{
log
=
localLog
=
new
StringWriter
();
log
=
localLog
=
new
StringWriter
();
...
@@ -274,12 +271,6 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
...
@@ -274,12 +271,6 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
Skip
.
Inconclusive
(
failMessage
+
"Server is not available"
);
Skip
.
Inconclusive
(
failMessage
+
"Server is not available"
);
}
}
handle
=
GCHandle
.
Alloc
(
muxer
);
lock
(
ActiveMultiplexers
)
{
ActiveMultiplexers
.
Add
(
handle
);
}
muxer
.
InternalError
+=
OnInternalError
;
muxer
.
InternalError
+=
OnInternalError
;
muxer
.
ConnectionFailed
+=
OnConnectionFailed
;
muxer
.
ConnectionFailed
+=
OnConnectionFailed
;
muxer
.
MessageFaulted
+=
(
msg
,
ex
,
origin
)
=>
muxer
.
MessageFaulted
+=
(
msg
,
ex
,
origin
)
=>
...
@@ -297,19 +288,7 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
...
@@ -297,19 +288,7 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
}
}
muxer
.
InfoMessage
+=
msg
=>
Writer
.
WriteLine
(
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
=>
muxer
.
Closing
+=
complete
=>
Writer
.
WriteLine
(
complete
?
"Closed"
:
"Closing..."
);
{
int
count
;
lock
(
ActiveMultiplexers
)
{
count
=
ActiveMultiplexers
.
Count
;
if
(
complete
)
{
ActiveMultiplexers
.
Remove
(
handle
);
}
}
Writer
.
WriteLine
((
complete
?
"Closed ("
:
"Closing... ("
)
+
count
.
ToString
()
+
" remaining)"
);
};
return
muxer
;
return
muxer
;
}
}
catch
catch
...
...
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