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 <seanhaizi@163.com>
  • Loading branch information
SeanHai committed Dec 11, 2023
1 parent c8de94b commit d0cd3fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion curvefs/test/metaserver/copyset/raft_cli_service2_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ TEST_F(RaftCliService2Test, ChangePeerTest) {

// change peer succeed
{
sleep(60);
// sleep(60);
ChangePeersRequest2 request;
ChangePeersResponse2 response;
SetRequestPoolAndCopysetId(&request);
Expand Down

0 comments on commit d0cd3fc

Please sign in to comment.