github-actions[bot] commented on code in PR #41818:
URL: https://github.com/apache/doris/pull/41818#discussion_r1799576953
##########
be/src/io/cache/block_file_cache.h:
##########
@@ -19,6 +19,7 @@
#include <bvar/bvar.h>
Review Comment:
warning: 'bvar/bvar.h' file not found [clang-diagnostic-error]
```cpp
#include <bvar/bvar.h>
^
```
##########
be/src/io/cache/block_file_cache.h:
##########
@@ -27,15 +28,52 @@
#include "io/cache/file_block.h"
#include "io/cache/file_cache_common.h"
#include "io/cache/file_cache_storage.h"
+#include "util/threadpool.h"
namespace doris::io {
+// Note: the cache_lock is scoped, so do not add do...while(0) here.
+#ifdef ENABLE_CACHE_LOCK_DEBUG
+#define SCOPED_CACHE_LOCK(MUTEX)
\
+ std::chrono::time_point<std::chrono::high_resolution_clock> start_time =
\
+ std::chrono::high_resolution_clock::now();
\
+ std::lock_guard cache_lock(MUTEX); \
+ std::chrono::time_point<std::chrono::high_resolution_clock> acq_time =
\
+ std::chrono::high_resolution_clock::now();
\
+ auto duration =
\
+ std::chrono::duration_cast<std::chrono::milliseconds>(acq_time -
start_time) \
+ .count();
\
+ if (duration > config::cache_lock_long_tail_threshold)
\
+ LOG(WARNING) << "Lock wait time " << std::to_string(duration) << "ms.
" \
+ << get_stack_trace_by_boost() << std::endl;
+#else
+#define SCOPED_CACHE_LOCK(MUTEX) \
+ std::lock_guard cache_lock(MUTEX);
+#endif
+
template <class Lock>
concept IsXLock = std::same_as<Lock, std::lock_guard<std::mutex>> ||
std::same_as<Lock, std::unique_lock<std::mutex>>;
class FSFileCacheStorage;
+class LockScopedTimer {
+public:
+ LockScopedTimer() : start_(std::chrono::high_resolution_clock::now()) {}
Review Comment:
warning: use '= default' to define a trivial default constructor
[modernize-use-equals-default]
```suggestion
LockScopedTimer() : start_(std::chrono::high_resolution_clock::now()) =
default;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]