Skip to content

Commit

Permalink
fix metaserver deadlock caused by bthread coroutine switching
Browse files Browse the repository at this point in the history
Signed-off-by: wanghai01 <[email protected]>
  • Loading branch information
SeanHai committed Dec 11, 2023
1 parent c8de94b commit 9e5bbb9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion curvefs/src/metaserver/partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ Partition::Partition(PartitionInfo partition,
}

if (partitionInfo_.status() != PartitionStatus::DELETING) {
TrashManager::GetInstance().Add(partitionInfo_.partitionid(), trash);
auto handle = std::async(std::launch::async, [&]() {
TrashManager::GetInstance().Add(
partitionInfo_.partitionid(), trash);
});
handle.wait();

if (startCompact) {
StartS3Compact();
}
Expand Down

0 comments on commit 9e5bbb9

Please sign in to comment.