mirror of
https://github.com/ceph/ceph
synced 2025-01-29 22:43:40 +00:00
Merge pull request #30840 from majianpeng/async-messenger-narrow-lock
msg/async: narrow scope of AsyncMessenger::lock in fun connect_to. Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
commit
3ae93a77c6
@ -680,7 +680,6 @@ ConnectionRef AsyncMessenger::connect_to(int type,
|
||||
const entity_addrvec_t& addrs,
|
||||
bool anon)
|
||||
{
|
||||
std::lock_guard l{lock};
|
||||
if (*my_addrs == addrs ||
|
||||
(addrs.v.size() == 1 &&
|
||||
my_addrs->contains(addrs.front()))) {
|
||||
@ -688,6 +687,8 @@ ConnectionRef AsyncMessenger::connect_to(int type,
|
||||
return local_connection;
|
||||
}
|
||||
|
||||
std::lock_guard l{lock};
|
||||
|
||||
auto av = _filter_addrs(addrs);
|
||||
|
||||
if (anon) {
|
||||
|
Loading…
Reference in New Issue
Block a user