Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/20016 )
Change subject: async_logger: Workaround for randomly failing to create logfile ...................................................................... Patch Set 1: (1 comment) http://gerrit.cloudera.org:8080/#/c/20016/1/src/kudu/util/async_logger.cc File src/kudu/util/async_logger.cc: http://gerrit.cloudera.org:8080/#/c/20016/1/src/kudu/util/async_logger.cc@136 PS1, Line 136: std::unique_ptr<MutexLock> write_lock; : // There is a bug in glog, GetLoggingDirectories is not thread-safe at first run and it can : // cause trouble if two writes happen at the same time. This workaround makes sure that the : // first write is not overlapping with any other write. : if (PREDICT_FALSE(first_write)) { : write_lock.reset(new MutexLock(first_write_lock_)); : first_write = false; : } Is it possible to simply call GetLoggingDirectories() once in AsyncLogger::Start() and move the comment into that method? If there are any concerns with calling Start() concurrently, you can save the return value of GetLoggingDirectories() into a static variable in the scope of AsyncLogger::Start() (or use std::call_once(), but the latter is an overkill, I guess). -- To view, visit http://gerrit.cloudera.org:8080/20016 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3e5cb73261015833c45ca5dd24e03bd1198b55ef Gerrit-Change-Number: 20016 Gerrit-PatchSet: 1 Gerrit-Owner: Ádám Bakai <aba...@cloudera.com> Gerrit-Reviewer: Alexey Serbin <ale...@apache.org> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Comment-Date: Tue, 06 Jun 2023 18:42:25 +0000 Gerrit-HasComments: Yes