Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sbroad
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
sbroad
Commits
177ed5df
Commit
177ed5df
authored
8 months ago
by
Denis Smirnov
Browse files
Options
Downloads
Patches
Plain Diff
fix: LRU inconsistency on eviction failure
parent
213d358f
No related branches found
No related tags found
1 merge request
!495
Resolve "Prepared statement with id XXX does not exist"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sbroad-core/src/executor/lru.rs
+6
-1
6 additions, 1 deletion
sbroad-core/src/executor/lru.rs
with
6 additions
and
1 deletion
sbroad-core/src/executor/lru.rs
+
6
−
1
View file @
177ed5df
...
...
@@ -180,6 +180,7 @@ where
};
let
map
=
&
mut
self
.map
;
let
mut
evict_result
=
None
;
if
let
Some
(
evict_fn
)
=
&
self
.evict_fn
{
let
head_prev
=
map
.get_mut
(
&
head_prev_id
)
.ok_or_else
(||
{
SbroadError
::
NotFound
(
...
...
@@ -187,7 +188,8 @@ where
format_smolstr!
(
"(mutable LRU) with key {:?}"
,
&
head_prev_id
),
)
})
?
;
evict_fn
(
key
,
&
mut
head_prev
.value
)
?
;
// If eviction function failed, we still need to remove the node.
evict_result
=
Some
(
evict_fn
(
key
,
&
mut
head_prev
.value
));
}
self
.unlink_node
(
&
head_prev_id
)
?
;
...
...
@@ -195,6 +197,9 @@ where
self
.map
.remove
(
&
Some
(
last_key
.clone
()));
self
.size
-=
1
;
}
if
let
Some
(
evict_result
)
=
evict_result
{
evict_result
?
;
}
Ok
(())
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment