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
a335a78a
Commit
a335a78a
authored
Jun 11, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Detect changes to the run_id when connecting; if observed, reset the script cache
parent
bb3b5e69
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
DebuggingAids.cs
StackExchange.Redis/StackExchange/Redis/DebuggingAids.cs
+17
-0
ResultProcessor.cs
StackExchange.Redis/StackExchange/Redis/ResultProcessor.cs
+5
-1
ServerEndPoint.cs
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
+1
-1
No files found.
StackExchange.Redis/StackExchange/Redis/DebuggingAids.cs
View file @
a335a78a
...
...
@@ -101,6 +101,23 @@ Task<string> IRedisAsync.ClientGetNameAsync(CommandFlags flags)
partial
class
ServerEndPoint
{
private
string
runId
;
internal
string
RunId
{
get
{
return
runId
;
}
set
{
if
(
value
!=
runId
)
// we only care about changes
{
// if we had an old run-id, and it has changed, then the
// server has been restarted; which means the script cache
// is toast
if
(
runId
!=
null
)
FlushScriptCache
();
runId
=
value
;
}
}
}
internal
void
SimulateConnectionFailure
()
{
var
tmp
=
interactive
;
...
...
StackExchange.Redis/StackExchange/Redis/ResultProcessor.cs
View file @
a335a78a
...
...
@@ -538,6 +538,10 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
break
;
}
}
else
if
((
val
=
Extract
(
line
,
"run_id:"
))
!=
null
)
{
server
.
RunId
=
val
;
}
}
}
}
...
...
@@ -1037,7 +1041,7 @@ public override bool SetResult(PhysicalConnection connection, Message message, R
{
if
(
result
.
Type
==
ResultType
.
Error
&&
result
.
AssertStarts
(
NOSCRIPT
))
{
// scripts are not flushed individually, so assume the entire script cache is toast ("SCRIPT FLUSH")
connection
.
Bridge
.
ServerEndPoint
.
FlushScript
s
();
connection
.
Bridge
.
ServerEndPoint
.
FlushScript
Cache
();
message
.
SetScriptUnavailable
();
}
// and apply usual processing for the rest
...
...
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
View file @
a335a78a
...
...
@@ -319,7 +319,7 @@ internal Task Close()
return
result
;
}
internal
void
FlushScript
s
()
internal
void
FlushScript
Cache
()
{
lock
(
knownScripts
)
{
...
...
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