Skip to content

Commit 6463c9c

Browse files
authoredJun 23, 2024
Merge pull request ClickHouse#25 from ClickHouse/fix-tsan-condvar
Fix TSan report around condvar in HostResolver
2 parents ac9161f + e55b7df commit 6463c9c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/aws-cpp-sdk-core/source/auth/GeneralHTTPCredentialsProvider.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ bool GeneralHTTPCredentialsProvider::ShouldCreateGeneralHTTPProvider(const Aws::
122122
shouldAllow = !addresses.empty();
123123
hostResolved = true;
124124
}
125-
hostResolverCV.notify_one();
125+
else
126+
{
127+
std::unique_lock<std::mutex> lock(hostResolverMutex);
128+
hostResolverCV.notify_one();
129+
}
126130
};
127131
pHostResolver->ResolveHost(authority.c_str(), onHostResolved);
128132
std::unique_lock<std::mutex> lock(hostResolverMutex);
@@ -259,4 +263,4 @@ void GeneralHTTPCredentialsProvider::RefreshIfExpired()
259263
}
260264

261265
Reload();
262-
}
266+
}

0 commit comments

Comments
 (0)
Please sign in to comment.