Merge pull request #22560 from azat/tiny-log-rwlock-ub-fix

Fix UB by unlocking the rwlock of the TinyLog from the same thread
This commit is contained in:
alexey-milovidov 2021-04-03 21:59:01 +03:00 committed by GitHub
commit 67fdfd4b89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -357,6 +357,8 @@ void TinyLogBlockOutputStream::writeSuffix()
for (const auto & file : column_files)
storage.file_checker.update(file);
storage.file_checker.save();
lock.unlock();
}

View File

@ -70,7 +70,7 @@ private:
Files files;
FileChecker file_checker;
mutable std::shared_timed_mutex rwlock;
std::shared_timed_mutex rwlock;
Poco::Logger * log;