Skip to content

Commit

Permalink
Merge pull request #25 from ClickHouse/fix-tsan-condvar
Browse files Browse the repository at this point in the history
Fix TSan report around condvar in HostResolver
  • Loading branch information
alexey-milovidov authored Jun 23, 2024
2 parents ac9161f + e55b7df commit 6463c9c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ bool GeneralHTTPCredentialsProvider::ShouldCreateGeneralHTTPProvider(const Aws::
shouldAllow = !addresses.empty();
hostResolved = true;
}
hostResolverCV.notify_one();
else
{
std::unique_lock<std::mutex> lock(hostResolverMutex);
hostResolverCV.notify_one();
}
};
pHostResolver->ResolveHost(authority.c_str(), onHostResolved);
std::unique_lock<std::mutex> lock(hostResolverMutex);
Expand Down Expand Up @@ -259,4 +263,4 @@ void GeneralHTTPCredentialsProvider::RefreshIfExpired()
}

Reload();
}
}

0 comments on commit 6463c9c

Please sign in to comment.