Exposing blocking client to Python via PyO3 causes get request to hang indefinitely #2084
-
Hi there, I have a structure called The exact code I'm working with is here: https://github.com/nyx-space/anise/blob/7b9b0d926fcb331a256500b8ad0e586e0bda81c2/anise/src/almanac/meta.rs#L193 . Here is the relevant Rust code: let client = reqwest::blocking::Client::builder()
.connect_timeout(Duration::from_secs(30))
.timeout(Duration::from_secs(30))
.build()
.unwrap();
println!("built");
match client.get(url.clone()).send() {
Ok(resp) => {
println!("resp");
if resp.status().is_success() {
// ... When called from Python, it blocks forever on the start of this >>> MetaFile("http://google.com/robots.txt").process()
built
Any idea what could be happening here? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sorry, I'm not sure what the problem is. The only thing I can think of is that Python's GIL can cause locks when multi-threading, but probably not in this case. Still, it's the only thing that comes to mind, |
Beta Was this translation helpful? Give feedback.
That was the issue indeed: PyO3/pyo3#3732 (comment) .