Skip to content

Commit 6fb5fe9

Browse files
authored
fix(executor): catch unwind for executor on_init and on_finished (#10980)
* fix(executor): catch unwind for executor on_init and on_finished * fix(executor): catch unwind for executor on_init and on_finished
1 parent 00b7bc9 commit 6fb5fe9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/query/service/src/pipelines/executor/pipeline_executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl PipelineExecutor {
155155
let mut guard = self.on_finished_callback.lock();
156156
if let Some(on_finished_callback) = guard.take() {
157157
drop(guard);
158-
(on_finished_callback)(error)?;
158+
catch_unwind(move || on_finished_callback(error))??;
159159
}
160160

161161
Ok(())
@@ -221,7 +221,7 @@ impl PipelineExecutor {
221221
let mut guard = self.on_init_callback.lock();
222222
if let Some(callback) = guard.take() {
223223
drop(guard);
224-
if let Err(cause) = callback() {
224+
if let Err(cause) = Result::flatten(catch_unwind(callback)) {
225225
return Err(cause.add_message_back("(while in query pipeline init)"));
226226
}
227227
}

0 commit comments

Comments
 (0)