Skip to content

Commit

Permalink
Try fix for deadlock problem
Browse files Browse the repository at this point in the history
  • Loading branch information
magbak committed Aug 14, 2024
1 parent e596344 commit e53d7ef
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
30 changes: 12 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ oxrdfio = { version= "0.1.0-alpha.6", features = ["rdf-star"] }
polars = "0.41.3"
tokio = "1.32.1"
log = "0.4.21"
pyo3 = "0.22.1"
pyo3 = "0.22.2"
reqwest = "0.12.3"
env_logger = "0.11.3"
thiserror = "1.0.58"
Expand Down
17 changes: 9 additions & 8 deletions py_chrontext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,15 @@ impl PyEngine {
if self.engine.is_none() {
self.init()?;
}

let mut builder = Builder::new_multi_thread();
builder.enable_all();
let (mut df, mut datatypes, pushdown_contexts) = builder
.build()
.unwrap()
.block_on(self.engine.as_mut().unwrap().query(sparql))
.map_err(|err| PyChrontextError::QueryExecutionError(err))?;
let (mut df, mut datatypes, pushdown_contexts) = py.allow_threads(move || {
let mut builder = Builder::new_multi_thread();
builder.enable_all();
builder
.build()
.unwrap()
.block_on(self.engine.as_mut().unwrap().query(sparql))
.map_err(|err| PyChrontextError::QueryExecutionError(err))
})?;

(df, datatypes) =
fix_cats_and_multicolumns(df, datatypes, native_dataframe.unwrap_or(false));
Expand Down

0 comments on commit e53d7ef

Please sign in to comment.