Skip to content

Commit

Permalink
Remove Arcs from QE (#5548)
Browse files Browse the repository at this point in the history
## Description
This was added as an optimization in #5472. However, it seems to be the
cause of a transient bug that is causing the language server to crash
outlined in #5531.

We should revert this optimization until we understand how to avoid this
crash from happening. cc @tritao

## Checklist

- [x] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
  • Loading branch information
JoshuaBatty committed Feb 5, 2024
1 parent 6ef4551 commit 335754f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sway-core/src/query_engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ pub type ProgramsCacheMap = HashMap<ModulePath, ProgramsCacheEntry>;

#[derive(Debug, Default)]
pub struct QueryEngine {
parse_module_cache: Arc<RwLock<ModuleCacheMap>>,
programs_cache: Arc<RwLock<ProgramsCacheMap>>,
parse_module_cache: RwLock<ModuleCacheMap>,
programs_cache: RwLock<ProgramsCacheMap>,
}

impl Clone for QueryEngine {
fn clone(&self) -> Self {
Self {
parse_module_cache: self.parse_module_cache.clone(),
programs_cache: self.programs_cache.clone(),
parse_module_cache: RwLock::new(self.parse_module_cache.read().unwrap().clone()),
programs_cache: RwLock::new(self.programs_cache.read().unwrap().clone()),
}
}
}
Expand Down

0 comments on commit 335754f

Please sign in to comment.