Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(query): remove unexpected strong ref for http query #13807

Merged
merged 7 commits into from
Nov 27, 2023
Prev Previous commit
Next Next commit
fix(query): remove unexpected strong ref for http query
zhang2014 committed Nov 26, 2023
commit 85325929c8193d67b08ca4e68484d5bb58350ca3
Original file line number Diff line number Diff line change
@@ -78,8 +78,12 @@ impl HttpQueryManager {

let self_clone = self.clone();
let query_id_clone = query_id.to_string();
let http_query_weak = Arc::downgrade(&query);
let query_result_timeout_secs = query.result_timeout_secs;

// downgrade to weak reference
// it may cannot destroy with final or kill when we hold ref of Arc<HttpQuery>
let http_query_weak = Arc::downgrade(&query);

GlobalIORuntime::instance().spawn(query_id, async move {
loop {
let expire_res = match http_query_weak.upgrade() {