Merge pull request #31929 from majianpeng/msg-async-bugfix

msg/async: update refcount and perf counter properly

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2020-01-07 16:28:30 +08:00 committed by GitHub
commit b59cc672a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -201,6 +201,7 @@ void Processor::accept()
accept_error_num = 0;
continue;
} else {
--w->references;
if (r == -EINTR) {
continue;
} else if (r == -EAGAIN) {

View File

@ -397,7 +397,7 @@ public:
*/
void unregister_conn(const AsyncConnectionRef& conn) {
std::lock_guard l{deleted_lock};
if (!accepting_conns.count(conn))
if (!accepting_conns.count(conn) || anon_conns.count(conn))
conn->get_perf_counter()->dec(l_msgr_active_connections);
deleted_conns.emplace(std::move(conn));
conn->unregister();