Skip to content

Commit

Permalink
fix: access TASKS in block_in_place
Browse files Browse the repository at this point in the history
  • Loading branch information
koivunej committed Nov 28, 2022
1 parent 376e5af commit afe537f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pageserver/src/task_mgr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,13 @@ async fn task_finish(
shutdown_process_on_error: bool,
) {
// Remove our entry from the global hashmap.
let task = TASKS
.lock()
.unwrap()
.remove(&task_id)
.expect("no task in registry");
let task = tokio::task::block_in_place(|| {
TASKS
.lock()
.unwrap()
.remove(&task_id)
.expect("no task in registry")
});

let mut shutdown_process = false;
{
Expand Down

0 comments on commit afe537f

Please sign in to comment.