Skip to content

Commit 3ed04b6

Browse files
Merge pull request ceph#63390 from taodd/fix-ms_async_op_threads
common: fix the ms_async_op_threads not applied successfully for daemons running in foreground mode
2 parents d566702 + 30d66ff commit 3ed04b6

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/common/ceph_context.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,19 @@ CryptoHandler *CephContext::get_crypto_handler(int type)
10841084
}
10851085
}
10861086

1087+
void CephContext::drop_temp_messenger_obj()
1088+
{
1089+
auto i = associated_objs.begin();
1090+
while (i != associated_objs.end()) {
1091+
if (i->first.first.find("AsyncMessenger::NetworkStack") != std::string::npos) {
1092+
i = associated_objs.erase(i);
1093+
break;
1094+
} else {
1095+
++i;
1096+
}
1097+
}
1098+
}
1099+
10871100
void CephContext::notify_pre_fork()
10881101
{
10891102
{

src/common/ceph_context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ class CephContext {
284284
_fork_watchers.push_back(w);
285285
}
286286

287+
void drop_temp_messenger_obj();
287288
void notify_pre_fork();
288289
void notify_post_fork();
289290

src/global/global_init.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ int global_init_prefork(CephContext *cct)
503503
chown_path(conf->pid_file, cct->get_set_uid(), cct->get_set_gid(),
504504
cct->get_set_uid_string(), cct->get_set_gid_string());
505505
}
506-
506+
cct->drop_temp_messenger_obj();
507507
return -1;
508508
}
509509

0 commit comments

Comments
 (0)