-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix data race in context #55260
Fix data race in context #55260
Conversation
This is an automated comment for commit 9df0b8f with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page Successful checks
|
src/Interpreters/Context.cpp
Outdated
shared->system_logs = std::make_unique<SystemLogs>(getGlobalContext(), getConfigRef()); | ||
}); | ||
auto lock = getGlobalLock(); | ||
shared->system_logs = std::make_unique<SystemLogs>(getGlobalContext(), getConfigRef()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this fix pass tests we need to remove shared->system_logs_initializer
.
But I suspect this can lead to deadlock because SystemLogs constructor can call context methods.
Proper fix should be something like this:
callOnce(shared->system_logs_initializer, [&] {
auto system_logs = std::make_unique<SystemLogs>(getGlobalContext(), getConfigRef());
auto lock = getGlobalLock();
shared->system_logs = std::move(system_logs);
});
porting ClickHouse/ClickHouse#55260 on Oct 7
Changelog category (leave one):
Looks broken after #55121.
See https://s3.amazonaws.com/clickhouse-test-reports/55252/c57a92f5fcdf2b131ebbcc6758260399e8ca976d/stress_test__tsan_/stderr.log.